Skip to content

Commit 1fbdbcb

Browse files
Release 22.8
1 parent 7856c47 commit 1fbdbcb

File tree

775 files changed

+112969
-0
lines changed

Some content is hidden

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

775 files changed

+112969
-0
lines changed

v2208/api/api_client.go

+562
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="accept_all_revisions_online_request.go">
4+
* Copyright (c) 2022 Aspose.Words for Cloud
5+
* </copyright>
6+
* <summary>
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
* </summary>
25+
* --------------------------------------------------------------------------------
26+
*/
27+
28+
package models
29+
30+
import (
31+
"io/ioutil"
32+
"net/url"
33+
"strings"
34+
"io"
35+
"encoding/json"
36+
"mime/multipart"
37+
)
38+
39+
// AcceptAllRevisionsOnlineRequest contains request data for WordsApiService.AcceptAllRevisionsOnline method.
40+
type AcceptAllRevisionsOnlineRequest struct {
41+
// The document.
42+
Document io.ReadCloser
43+
/* optional (nil or map[string]interface{}) with one or more of key / value pairs:
44+
key: "loadEncoding" value: (*string) Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
45+
key: "password" value: (*string) Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
46+
key: "encryptedPassword" value: (*string) Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
47+
key: "destFileName" value: (*string) Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document. */
48+
Optionals map[string]interface{}
49+
}
50+
51+
52+
func (data *AcceptAllRevisionsOnlineRequest) CreateRequestData() (RequestData, error) {
53+
54+
var result RequestData
55+
56+
result.Method = strings.ToUpper("put")
57+
58+
// create path and map variables
59+
result.Path = "/words/online/put/revisions/acceptAll"
60+
61+
result.Path = strings.Replace(result.Path, "/<nil>", "", -1)
62+
result.Path = strings.Replace(result.Path, "//", "/", -1)
63+
64+
result.HeaderParams = make(map[string]string)
65+
result.QueryParams = url.Values{}
66+
result.FormParams = make([]FormParamContainer, 0)
67+
68+
69+
if err := typeCheckParameter(data.Optionals["loadEncoding"], "string", "data.Optionals[loadEncoding]"); err != nil {
70+
return result, err
71+
}
72+
if err := typeCheckParameter(data.Optionals["password"], "string", "data.Optionals[password]"); err != nil {
73+
return result, err
74+
}
75+
if err := typeCheckParameter(data.Optionals["encryptedPassword"], "string", "data.Optionals[encryptedPassword]"); err != nil {
76+
return result, err
77+
}
78+
if err := typeCheckParameter(data.Optionals["destFileName"], "string", "data.Optionals[destFileName]"); err != nil {
79+
return result, err
80+
}
81+
82+
83+
if localVarTempParam, localVarOk := data.Optionals["loadEncoding"].(string); localVarOk {
84+
result.QueryParams.Add("LoadEncoding", parameterToString(localVarTempParam, ""))
85+
}
86+
87+
88+
if localVarTempParam, localVarOk := data.Optionals["password"].(string); localVarOk {
89+
result.QueryParams.Add("Password", parameterToString(localVarTempParam, ""))
90+
}
91+
92+
93+
if localVarTempParam, localVarOk := data.Optionals["encryptedPassword"].(string); localVarOk {
94+
result.QueryParams.Add("EncryptedPassword", parameterToString(localVarTempParam, ""))
95+
}
96+
97+
98+
if localVarTempParam, localVarOk := data.Optionals["destFileName"].(string); localVarOk {
99+
result.QueryParams.Add("DestFileName", parameterToString(localVarTempParam, ""))
100+
}
101+
102+
103+
// to determine the Content-Type header
104+
localVarHttpContentTypes := []string{ "multipart/form-data", }
105+
106+
// set Content-Type header
107+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
108+
if localVarHttpContentType != "" {
109+
result.HeaderParams["Content-Type"] = localVarHttpContentType
110+
}
111+
112+
// to determine the Accept header
113+
localVarHttpHeaderAccepts := []string{
114+
"application/xml",
115+
"application/json",
116+
}
117+
118+
// set Accept header
119+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
120+
if localVarHttpHeaderAccept != "" {
121+
result.HeaderParams["Accept"] = localVarHttpHeaderAccept
122+
}
123+
124+
125+
_document := data.Document
126+
if _document != nil {
127+
fbs, _ := ioutil.ReadAll(_document)
128+
_document.Close()
129+
result.FormParams = append(result.FormParams, NewFileFormParamContainer("document", fbs))
130+
}
131+
132+
133+
134+
return result, nil
135+
}
136+
137+
func (data *AcceptAllRevisionsOnlineRequest) CreateResponse(reader io.Reader, boundary string) (response interface{}, err error) {
138+
var successPayload AcceptAllRevisionsOnlineResponse
139+
var part *multipart.Part
140+
141+
mr := multipart.NewReader(reader, boundary)
142+
part, err = mr.NextPart()
143+
144+
if err != nil && err != io.EOF {
145+
return successPayload, err
146+
}
147+
148+
if err = json.NewDecoder(part).Decode(&successPayload.Model); err != nil {
149+
return successPayload, err
150+
}
151+
152+
153+
part, err = mr.NextPart()
154+
155+
if err != nil && err != io.EOF {
156+
return successPayload, err
157+
}
158+
159+
successPayload.Document, err = ParsePartFilesCollection(part)
160+
if err != nil {
161+
return successPayload, err
162+
}
163+
164+
165+
return successPayload, err
166+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="accept_all_revisions_online_response.go">
4+
* Copyright (c) 2022 Aspose.Words for Cloud
5+
* </copyright>
6+
* <summary>
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
* </summary>
25+
* --------------------------------------------------------------------------------
26+
*/
27+
28+
package models
29+
30+
import "io"
31+
32+
33+
// AcceptAllRevisionsOnlineResponse struct
34+
// Accepts all revisions in the document.
35+
type AcceptAllRevisionsOnlineResponse struct {
36+
// The response model.
37+
Model RevisionsModificationResponse `json:"Model,omitempty"`
38+
39+
40+
// The document after modification.
41+
Document map[string]io.Reader `json:"Document,omitempty"`
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="accept_all_revisions_request.go">
4+
* Copyright (c) 2022 Aspose.Words for Cloud
5+
* </copyright>
6+
* <summary>
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
* </summary>
25+
* --------------------------------------------------------------------------------
26+
*/
27+
28+
package models
29+
30+
import (
31+
"fmt"
32+
"net/url"
33+
"strings"
34+
"io"
35+
"encoding/json"
36+
)
37+
38+
// AcceptAllRevisionsRequest contains request data for WordsApiService.AcceptAllRevisions method.
39+
type AcceptAllRevisionsRequest struct {
40+
// The filename of the input document.
41+
Name *string
42+
/* optional (nil or map[string]interface{}) with one or more of key / value pairs:
43+
key: "folder" value: (*string) Original document folder.
44+
key: "storage" value: (*string) Original document storage.
45+
key: "loadEncoding" value: (*string) Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
46+
key: "password" value: (*string) Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
47+
key: "encryptedPassword" value: (*string) Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
48+
key: "destFileName" value: (*string) Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document. */
49+
Optionals map[string]interface{}
50+
}
51+
52+
53+
func (data *AcceptAllRevisionsRequest) CreateRequestData() (RequestData, error) {
54+
55+
var result RequestData
56+
57+
result.Method = strings.ToUpper("put")
58+
59+
// create path and map variables
60+
result.Path = "/words/{name}/revisions/acceptAll"
61+
result.Path = strings.Replace(result.Path, "{"+"name"+"}", fmt.Sprintf("%v", *data.Name), -1)
62+
63+
result.Path = strings.Replace(result.Path, "/<nil>", "", -1)
64+
result.Path = strings.Replace(result.Path, "//", "/", -1)
65+
66+
result.HeaderParams = make(map[string]string)
67+
result.QueryParams = url.Values{}
68+
result.FormParams = make([]FormParamContainer, 0)
69+
70+
71+
if err := typeCheckParameter(data.Optionals["folder"], "string", "data.Optionals[folder]"); err != nil {
72+
return result, err
73+
}
74+
if err := typeCheckParameter(data.Optionals["storage"], "string", "data.Optionals[storage]"); err != nil {
75+
return result, err
76+
}
77+
if err := typeCheckParameter(data.Optionals["loadEncoding"], "string", "data.Optionals[loadEncoding]"); err != nil {
78+
return result, err
79+
}
80+
if err := typeCheckParameter(data.Optionals["password"], "string", "data.Optionals[password]"); err != nil {
81+
return result, err
82+
}
83+
if err := typeCheckParameter(data.Optionals["encryptedPassword"], "string", "data.Optionals[encryptedPassword]"); err != nil {
84+
return result, err
85+
}
86+
if err := typeCheckParameter(data.Optionals["destFileName"], "string", "data.Optionals[destFileName]"); err != nil {
87+
return result, err
88+
}
89+
90+
91+
if localVarTempParam, localVarOk := data.Optionals["folder"].(string); localVarOk {
92+
result.QueryParams.Add("Folder", parameterToString(localVarTempParam, ""))
93+
}
94+
95+
96+
if localVarTempParam, localVarOk := data.Optionals["storage"].(string); localVarOk {
97+
result.QueryParams.Add("Storage", parameterToString(localVarTempParam, ""))
98+
}
99+
100+
101+
if localVarTempParam, localVarOk := data.Optionals["loadEncoding"].(string); localVarOk {
102+
result.QueryParams.Add("LoadEncoding", parameterToString(localVarTempParam, ""))
103+
}
104+
105+
106+
if localVarTempParam, localVarOk := data.Optionals["password"].(string); localVarOk {
107+
result.QueryParams.Add("Password", parameterToString(localVarTempParam, ""))
108+
}
109+
110+
111+
if localVarTempParam, localVarOk := data.Optionals["encryptedPassword"].(string); localVarOk {
112+
result.QueryParams.Add("EncryptedPassword", parameterToString(localVarTempParam, ""))
113+
}
114+
115+
116+
if localVarTempParam, localVarOk := data.Optionals["destFileName"].(string); localVarOk {
117+
result.QueryParams.Add("DestFileName", parameterToString(localVarTempParam, ""))
118+
}
119+
120+
121+
// to determine the Content-Type header
122+
localVarHttpContentTypes := []string{ "application/xml", "application/json", }
123+
124+
// set Content-Type header
125+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
126+
if localVarHttpContentType != "" {
127+
result.HeaderParams["Content-Type"] = localVarHttpContentType
128+
}
129+
130+
// to determine the Accept header
131+
localVarHttpHeaderAccepts := []string{
132+
"application/xml",
133+
"application/json",
134+
}
135+
136+
// set Accept header
137+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
138+
if localVarHttpHeaderAccept != "" {
139+
result.HeaderParams["Accept"] = localVarHttpHeaderAccept
140+
}
141+
142+
143+
144+
145+
return result, nil
146+
}
147+
148+
func (data *AcceptAllRevisionsRequest) CreateResponse(reader io.Reader, boundary string) (response interface{}, err error) {
149+
var successPayload RevisionsModificationResponse
150+
if err = json.NewDecoder(reader).Decode(&successPayload); err != nil {
151+
return nil, err
152+
}
153+
154+
return successPayload, err
155+
}

0 commit comments

Comments
 (0)