Skip to content

Commit 4e807b1

Browse files
committed
Add repair api.
1 parent c947dd8 commit 4e807b1

File tree

4 files changed

+108
-6
lines changed

4 files changed

+108
-6
lines changed

api_cells.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28716,6 +28716,32 @@ func (a *CellsApiService) PostReverse(data *PostReverseRequest) (FilesResult, *h
2871628716
return localVarReturnValue, localVarHttpResponse, err
2871728717
}
2871828718

28719+
func (a *CellsApiService) PostRepair(data *PostRepairRequest) (FilesResult, *http.Response, error) {
28720+
var (
28721+
localVarReturnValue FilesResult
28722+
)
28723+
28724+
r, err := data.CreateRequestData(a.client)
28725+
if err != nil {
28726+
return localVarReturnValue, nil, err
28727+
}
28728+
28729+
localVarHttpResponse, err := a.client.callAPI(r)
28730+
if err != nil || localVarHttpResponse == nil {
28731+
return localVarReturnValue, localVarHttpResponse, err
28732+
}
28733+
defer localVarHttpResponse.Body.Close()
28734+
if localVarHttpResponse.StatusCode >= 300 {
28735+
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
28736+
return localVarReturnValue, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
28737+
}
28738+
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&localVarReturnValue); err != nil {
28739+
return localVarReturnValue, localVarHttpResponse, err
28740+
}
28741+
28742+
return localVarReturnValue, localVarHttpResponse, err
28743+
}
28744+
2871928745
func (a *CellsApiService) PostRotate(data *PostRotateRequest) (FilesResult, *http.Response, error) {
2872028746
var (
2872128747
localVarReturnValue FilesResult

go.mod

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
module github.com/aspose-cells-cloud/aspose-cells-cloud-go/v23
22

3-
43
go 1.15
5-
6-
require (
7-
github.com/jstemmer/go-junit-report v0.9.1 // indirect
8-
)

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=

request_post_repair_request.go

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/** --------------------------------------------------------------------------------------------------------------------
2+
* <copyright company="Aspose" file="post_repair_request.go">
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+
package asposecellscloud
27+
28+
import (
29+
"net/url"
30+
"net/http"
31+
"strings"
32+
)
33+
34+
type PostRepairRequest struct {
35+
Format string `json:"format,omitempty" xml:"format"`
36+
File map[string]string `json:"File,omitempty" xml:"File"`
37+
}
38+
39+
func (data *PostRepairRequest) CreateRequestData( client *APIClient) (localVarRequest *http.Request, err error) {
40+
var (
41+
localVarHttpMethod = strings.ToUpper("POST")
42+
localVarPostBody interface{}
43+
localVarFileName string
44+
localVarFileBytes []byte
45+
)
46+
47+
// create path and map variables
48+
localVarPath := client.cfg.BasePath + "/" + client.cfg.Version + "/cells/repair"
49+
50+
localVarHeaderParams := make(map[string]string)
51+
localVarQueryParams := url.Values{}
52+
localVarFormParams := url.Values{}
53+
54+
// query params : format
55+
if data.Format != "" {
56+
localVarQueryParams.Add("format", parameterToString(data.Format, ""))
57+
}
58+
59+
60+
localVarHttpContentTypes := []string{"multipart/form-data"}
61+
62+
// set Content-Type header
63+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
64+
if localVarHttpContentType != "" {
65+
localVarHeaderParams["Content-Type"] = localVarHttpContentType
66+
}
67+
68+
// to determine the Accept header
69+
localVarHttpHeaderAccepts := []string{"application/json"}
70+
71+
// set Accept header
72+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
73+
if localVarHttpHeaderAccept != "" {
74+
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
75+
}
76+
for name, path := range data.File {
77+
localVarFormParams["@"+name] = []string{path}
78+
}
79+
80+
r, err := client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
81+
return r,err
82+
}

0 commit comments

Comments
 (0)