Skip to content

Commit 6116e17

Browse files
committed
2 parents 28ef61f + 69749f8 commit 6116e17

File tree

6 files changed

+161
-10
lines changed

6 files changed

+161
-10
lines changed

README.md

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

23-
## Feature & Enhancements in Version 22.4
24-
25-
- Export API adds extended query parameters.
26-
- Convert API adds extended query parameters.
27-
- SaveAs API adds extended query parameters.
28-
- Get Workbook API adds extended query parameters.
29-
30-
## Feature & Enhancements in Version 22.4.1
31-
32-
- Fix return value for all APIs.
23+
## Feature & Enhancements in Version 22.5
3324

25+
- Add a new API for getting barcode description.
3426

3527
## Read & Write Spreadsheet Formats
3628

TestData/Book1.xlsx

19.6 KB
Binary file not shown.

api_cells.go

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8396,6 +8396,88 @@ func (a *CellsApiService) CellsPicturesGetWorksheetPicture(localVarOptionals *Ce
83968396
return localVarReturnValue, localVarHttpResponse, err
83978397
}
83988398

8399+
/*
8400+
CellsApiService Get chart area border info.
8401+
* @param name Workbook name.
8402+
* @param sheetName Worksheet name.
8403+
* @param pictureIndex The picture index.
8404+
* @param optional nil or *CellsPictureGetExtractBarcodesOpts - Optional Parameters:
8405+
* @param "Folder" (optional.String) - Workbook folder.
8406+
* @param "StorageName" (optional.String) - storage name.
8407+
8408+
@return BarcodeResponseList
8409+
*/
8410+
8411+
type CellsPictureGetExtractBarcodesOpts struct {
8412+
Name string
8413+
SheetName string
8414+
PictureIndex int64
8415+
Folder string
8416+
StorageName string
8417+
}
8418+
8419+
func (a *CellsApiService) CellsPictureGetExtractBarcodes(localVarOptionals *CellsPictureGetExtractBarcodesOpts) (BarcodeResponseList, *http.Response, error) {
8420+
var (
8421+
localVarHttpMethod = strings.ToUpper("Get")
8422+
localVarPostBody interface{}
8423+
localVarFileName string
8424+
localVarFileBytes []byte
8425+
localVarReturnValue BarcodeResponseList
8426+
)
8427+
8428+
// create path and map variables
8429+
localVarPath := a.client.cfg.BasePath + "/" + a.client.cfg.Version + "/cells/{name}/worksheets/{sheetName}/pictures/{pictureIndex}/recognize"
8430+
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", localVarOptionals.Name), -1)
8431+
localVarPath = strings.Replace(localVarPath, "{"+"sheetName"+"}", fmt.Sprintf("%v", localVarOptionals.SheetName), -1)
8432+
localVarPath = strings.Replace(localVarPath, "{"+"pictureIndex"+"}", fmt.Sprintf("%v", localVarOptionals.PictureIndex), -1)
8433+
8434+
localVarHeaderParams := make(map[string]string)
8435+
localVarQueryParams := url.Values{}
8436+
localVarFormParams := url.Values{}
8437+
8438+
if localVarOptionals != nil {
8439+
localVarQueryParams.Add("folder", parameterToString(localVarOptionals.Folder, ""))
8440+
}
8441+
if localVarOptionals != nil {
8442+
localVarQueryParams.Add("storageName", parameterToString(localVarOptionals.StorageName, ""))
8443+
}
8444+
// to determine the Content-Type header
8445+
localVarHttpContentTypes := []string{"application/json"}
8446+
8447+
// set Content-Type header
8448+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
8449+
if localVarHttpContentType != "" {
8450+
localVarHeaderParams["Content-Type"] = localVarHttpContentType
8451+
}
8452+
8453+
// to determine the Accept header
8454+
localVarHttpHeaderAccepts := []string{"application/json"}
8455+
8456+
// set Accept header
8457+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
8458+
if localVarHttpHeaderAccept != "" {
8459+
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
8460+
}
8461+
r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
8462+
if err != nil {
8463+
return localVarReturnValue, nil, err
8464+
}
8465+
8466+
localVarHttpResponse, err := a.client.callAPI(r)
8467+
if err != nil || localVarHttpResponse == nil {
8468+
return localVarReturnValue, localVarHttpResponse, err
8469+
}
8470+
defer localVarHttpResponse.Body.Close()
8471+
if localVarHttpResponse.StatusCode >= 300 {
8472+
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
8473+
return localVarReturnValue, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
8474+
}
8475+
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&localVarReturnValue); err != nil {
8476+
return localVarReturnValue, localVarHttpResponse, err
8477+
}
8478+
return localVarReturnValue, localVarHttpResponse, err
8479+
}
8480+
83998481
/*
84008482
CellsApiService Read worksheet pictures.
84018483
* @param name Document name.

api_cells_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6493,3 +6493,24 @@ func TestCellsSaveAsPostDocumentSaveAs_Extend(t *testing.T) {
64936493
fmt.Printf("%d\tTestCellsSaveAsPostDocumentSaveAs - %d\n", GetBaseTest().GetTestNumber(), response.Code)
64946494
}
64956495
}
6496+
6497+
func TestCellsPictureGetExtractBarcodes(t *testing.T) {
6498+
name := GetBook1()
6499+
if err := GetBaseTest().UploadFile(name); err != nil {
6500+
t.Error(err)
6501+
}
6502+
6503+
args := new(CellsPictureGetExtractBarcodesOpts)
6504+
args.Name = GetBook1()
6505+
args.SheetName = "Sheet8"
6506+
args.PictureIndex = 0
6507+
args.Folder = GetBaseTest().remoteFolder
6508+
_, httpResponse, err := GetBaseTest().CellsAPI.CellsPictureGetExtractBarcodes(args)
6509+
if err != nil {
6510+
t.Error(err)
6511+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
6512+
t.Fail()
6513+
} else {
6514+
fmt.Printf("%d\tTestCellsSaveAsPostDocumentSaveAs - %d\n", GetBaseTest().GetTestNumber(), 200)
6515+
}
6516+
}

model_barcode_response.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2022 Aspose.Cells Cloud
3+
* Permission is hereby granted, free of charge, to any person obtaining a copy
4+
* of this software and associated documentation files (the "Software"), to deal
5+
* in the Software without restriction, including without limitation the rights
6+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
* copies of the Software, and to permit persons to whom the Software is
8+
* furnished to do so, subject to the following conditions:
9+
*
10+
* The above copyright notice and this permission notice shall be included in all
11+
* copies or substantial portions of the Software.
12+
*
13+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
* SOFTWARE.
20+
*
21+
*/
22+
23+
package asposecellscloud
24+
25+
type BarcodeResponse struct {
26+
BarcodeValue string `json:"BarcodeValue,omitempty" xml:"BarcodeValue"`
27+
BarcodeType string `json:"BarcodeType,omitempty" xml:"BarcodeType"`
28+
Checksum string `json:"Checksum,omitempty" xml:"Checksum"`
29+
}

model_barcode_response_list.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2022 Aspose.Cells Cloud
3+
* Permission is hereby granted, free of charge, to any person obtaining a copy
4+
* of this software and associated documentation files (the "Software"), to deal
5+
* in the Software without restriction, including without limitation the rights
6+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
* copies of the Software, and to permit persons to whom the Software is
8+
* furnished to do so, subject to the following conditions:
9+
*
10+
* The above copyright notice and this permission notice shall be included in all
11+
* copies or substantial portions of the Software.
12+
*
13+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
* SOFTWARE.
20+
*
21+
*/
22+
23+
package asposecellscloud
24+
25+
type BarcodeResponseList struct {
26+
Barcodes []BarcodeResponse `json:"Barcodes,omitempty" xml:"Barcodes"`
27+
}

0 commit comments

Comments
 (0)