Skip to content

Commit d780d8f

Browse files
Merge remote-tracking branch 'origin/master' into release
2 parents eb9d169 + de42656 commit d780d8f

File tree

767 files changed

+110852
-31
lines changed

Some content is hidden

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

767 files changed

+110852
-31
lines changed

README.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,19 @@ Feel free to explore the [Developer's Guide](https://docs.aspose.cloud/display/w
1616
- Add & remove watermarks and protection.
1717
- Read & write access to Document Object Model.
1818

19+
## Enhancements in Version 22.4
20+
21+
- Added ExportShapesAsSvg to HtmlSaveOption.
22+
- Added new endpoint '~/styles/copy_from'.
23+
24+
1925
## Enhancements in Version 22.3
2026

2127
- Online methods returns the dictionary of files with included original filename as key instead of single file content in responses.
2228
- Parameters contained sensitive data should be passed in encrypted form. Names of the parameters have 'encrypted' prefix.
2329
- Added Encrypt method to encrypt data on the API public key. Use it to prepare values for parameters required encrypted data.
2430
- GetPublicKey method is not billable.
31+
- Changed type of enumerations for members of SaveOptionsData and other inherited classes from string to enum.
2532

2633

2734
## Enhancements in Version 22.2
@@ -236,35 +243,27 @@ Config.json file:
236243
Go code:
237244

238245
```
239-
// Start README example
240-
241-
// init words cloud api
242-
config, _ := models.NewConfiguration(configFilePath)
243-
wordsApi, ctx, _ := api.CreateWordsApi(config)
244-
245-
// upload test.docx to a cloud
246-
// remote.docx is a name in the cloud
247-
file, _ := os.Open(localFilePath)
248-
uploadRequest := &models.UploadFileRequest{
249-
FileContent: file,
250-
Path: &remotePath,
251-
}
252-
wordsApi.UploadFile(ctx, uploadRequest)
253-
254-
// get a text for the first paragraph of the first section
255-
options := map[string]interface{}{
256-
"folder": remoteFolder,
257-
}
258-
request := &models.GetParagraphsRequest{
259-
Name: &remoteName,
260-
Optionals: options,
261-
}
262-
263-
result, _, _ := wordsApi.GetParagraphs(ctx, request)
264-
265-
fmt.Println(result.Paragraphs.ParagraphLinkList[0].Text)
266-
267-
// End README example
246+
// Start README example
247+
248+
// init words cloud api
249+
config, _ := models.NewConfiguration(configFilePath)
250+
wordsApi, ctx, _ := api.CreateWordsApi(config)
251+
252+
// upload test.docx to a cloud
253+
// remote.docx is a name in the cloud
254+
file, _ := os.Open(localFilePath)
255+
wordsApi.UploadFile(ctx, file, remotePath, nil)
256+
257+
// get a text for the first paragraph of the first section
258+
options := map[string]interface{}{
259+
"folder": remoteFolder,
260+
}
261+
262+
result, _, _ := wordsApi.GetParagraphs(ctx, remoteName, options)
263+
264+
fmt.Println(result.Paragraphs.ParagraphLinkList[0].Text)
265+
266+
// End README example
268267
```
269268

270269
[Product Page](https://products.aspose.cloud/words/go) | [Documentation](https://docs.aspose.cloud/display/wordscloud/Home) | [API Reference](https://apireference.aspose.cloud/words/) | [Code Samples](https://github.com/aspose-words-cloud/aspose-words-cloud-go) | [Blog](https://blog.aspose.cloud/category/words/) | [Free Support](https://forum.aspose.cloud/c/words) | [Free Trial](https://dashboard.aspose.cloud/#/apps)

dev/api/api_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var (
6464
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
6565
)
6666

67-
// APIClient manages communication with the Aspose.Words for Cloud API Reference API v22.3
67+
// APIClient manages communication with the Aspose.Words for Cloud API Reference API v22.4
6868
// In most cases there should be only one, shared, APIClient.
6969
type APIClient struct {
7070
cfg *models.Configuration

dev/api/models/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func NewConfiguration(configFilePath string) (pConfig *Configuration, err error)
9999
cfg := Configuration{
100100
BaseUrl: "https://api.aspose.cloud",
101101
DebugMode: false,
102-
DefaultHeader: map[string]string{"x-aspose-client": "go sdk", "x-aspose-client-version": "22.3"},
102+
DefaultHeader: map[string]string{"x-aspose-client": "go sdk", "x-aspose-client-version": "22.4"},
103103
}
104104
err = json.Unmarshal(data, &cfg)
105105

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="copy_styles_from_template_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+
// CopyStylesFromTemplateRequest contains request data for WordsApiService.CopyStylesFromTemplate method.
39+
type CopyStylesFromTemplateRequest struct {
40+
// The filename of the target document.
41+
Name *string
42+
// The filename of the origin document.
43+
TemplateName *string
44+
/* optional (nil or map[string]interface{}) with one or more of key / value pairs:
45+
key: "folder" value: (*string) Original document folder.
46+
key: "storage" value: (*string) Original document storage.
47+
key: "loadEncoding" value: (*string) Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
48+
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.
49+
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.
50+
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.
51+
key: "revisionAuthor" value: (*string) Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
52+
key: "revisionDateTime" value: (*string) The date and time to use for revisions. */
53+
Optionals map[string]interface{}
54+
}
55+
56+
57+
func (data *CopyStylesFromTemplateRequest) CreateRequestData() (RequestData, error) {
58+
59+
var result RequestData
60+
61+
result.Method = strings.ToUpper("put")
62+
63+
// create path and map variables
64+
result.Path = "/words/{name}/styles/copy_from"
65+
result.Path = strings.Replace(result.Path, "{"+"name"+"}", fmt.Sprintf("%v", *data.Name), -1)
66+
67+
result.Path = strings.Replace(result.Path, "/<nil>", "", -1)
68+
result.Path = strings.Replace(result.Path, "//", "/", -1)
69+
70+
result.HeaderParams = make(map[string]string)
71+
result.QueryParams = url.Values{}
72+
result.FormParams = make([]FormParamContainer, 0)
73+
74+
75+
if err := typeCheckParameter(data.Optionals["folder"], "string", "data.Optionals[folder]"); err != nil {
76+
return result, err
77+
}
78+
if err := typeCheckParameter(data.Optionals["storage"], "string", "data.Optionals[storage]"); err != nil {
79+
return result, err
80+
}
81+
if err := typeCheckParameter(data.Optionals["loadEncoding"], "string", "data.Optionals[loadEncoding]"); err != nil {
82+
return result, err
83+
}
84+
if err := typeCheckParameter(data.Optionals["password"], "string", "data.Optionals[password]"); err != nil {
85+
return result, err
86+
}
87+
if err := typeCheckParameter(data.Optionals["encryptedPassword"], "string", "data.Optionals[encryptedPassword]"); err != nil {
88+
return result, err
89+
}
90+
if err := typeCheckParameter(data.Optionals["destFileName"], "string", "data.Optionals[destFileName]"); err != nil {
91+
return result, err
92+
}
93+
if err := typeCheckParameter(data.Optionals["revisionAuthor"], "string", "data.Optionals[revisionAuthor]"); err != nil {
94+
return result, err
95+
}
96+
if err := typeCheckParameter(data.Optionals["revisionDateTime"], "string", "data.Optionals[revisionDateTime]"); err != nil {
97+
return result, err
98+
}
99+
100+
101+
result.QueryParams.Add("TemplateName", parameterToString(*data.TemplateName, ""))
102+
103+
104+
if localVarTempParam, localVarOk := data.Optionals["folder"].(string); localVarOk {
105+
result.QueryParams.Add("Folder", parameterToString(localVarTempParam, ""))
106+
}
107+
108+
109+
if localVarTempParam, localVarOk := data.Optionals["storage"].(string); localVarOk {
110+
result.QueryParams.Add("Storage", parameterToString(localVarTempParam, ""))
111+
}
112+
113+
114+
if localVarTempParam, localVarOk := data.Optionals["loadEncoding"].(string); localVarOk {
115+
result.QueryParams.Add("LoadEncoding", parameterToString(localVarTempParam, ""))
116+
}
117+
118+
119+
if localVarTempParam, localVarOk := data.Optionals["password"].(string); localVarOk {
120+
result.QueryParams.Add("Password", parameterToString(localVarTempParam, ""))
121+
}
122+
123+
124+
if localVarTempParam, localVarOk := data.Optionals["encryptedPassword"].(string); localVarOk {
125+
result.QueryParams.Add("EncryptedPassword", parameterToString(localVarTempParam, ""))
126+
}
127+
128+
129+
if localVarTempParam, localVarOk := data.Optionals["destFileName"].(string); localVarOk {
130+
result.QueryParams.Add("DestFileName", parameterToString(localVarTempParam, ""))
131+
}
132+
133+
134+
if localVarTempParam, localVarOk := data.Optionals["revisionAuthor"].(string); localVarOk {
135+
result.QueryParams.Add("RevisionAuthor", parameterToString(localVarTempParam, ""))
136+
}
137+
138+
139+
if localVarTempParam, localVarOk := data.Optionals["revisionDateTime"].(string); localVarOk {
140+
result.QueryParams.Add("RevisionDateTime", parameterToString(localVarTempParam, ""))
141+
}
142+
143+
144+
// to determine the Content-Type header
145+
localVarHttpContentTypes := []string{ "application/xml", "application/json", }
146+
147+
// set Content-Type header
148+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
149+
if localVarHttpContentType != "" {
150+
result.HeaderParams["Content-Type"] = localVarHttpContentType
151+
}
152+
153+
// to determine the Accept header
154+
localVarHttpHeaderAccepts := []string{
155+
"application/xml",
156+
"application/json",
157+
}
158+
159+
// set Accept header
160+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
161+
if localVarHttpHeaderAccept != "" {
162+
result.HeaderParams["Accept"] = localVarHttpHeaderAccept
163+
}
164+
165+
166+
167+
168+
return result, nil
169+
}
170+
171+
func (data *CopyStylesFromTemplateRequest) CreateResponse(reader io.Reader, boundary string) (response interface{}, err error) {
172+
var successPayload WordsResponse
173+
if err = json.NewDecoder(reader).Decode(&successPayload); err != nil {
174+
return nil, err
175+
}
176+
177+
return successPayload, err
178+
}

dev/api/models/epub_save_options_data.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ type EpubSaveOptionsDataResult struct {
131131
// Container class for epub save options.
132132
ExportRoundtripInformation bool `json:"ExportRoundtripInformation,omitempty"`
133133

134+
// Container class for epub save options.
135+
ExportShapesAsSvg bool `json:"ExportShapesAsSvg,omitempty"`
136+
134137
// Container class for epub save options.
135138
ExportTextBoxAsSvg bool `json:"ExportTextBoxAsSvg,omitempty"`
136139

@@ -298,6 +301,9 @@ type EpubSaveOptionsData struct {
298301
// Container class for epub save options.
299302
ExportRoundtripInformation *bool `json:"ExportRoundtripInformation,omitempty"`
300303

304+
// Container class for epub save options.
305+
ExportShapesAsSvg *bool `json:"ExportShapesAsSvg,omitempty"`
306+
301307
// Container class for epub save options.
302308
ExportTextBoxAsSvg *bool `json:"ExportTextBoxAsSvg,omitempty"`
303309

@@ -488,6 +494,8 @@ func (obj *EpubSaveOptionsData) Initialize() {
488494

489495

490496

497+
498+
491499

492500

493501

dev/api/models/html_save_options_data.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ type HtmlSaveOptionsDataResult struct {
131131
// Container class for html save options.
132132
ExportRoundtripInformation bool `json:"ExportRoundtripInformation,omitempty"`
133133

134+
// Container class for html save options.
135+
ExportShapesAsSvg bool `json:"ExportShapesAsSvg,omitempty"`
136+
134137
// Container class for html save options.
135138
ExportTextBoxAsSvg bool `json:"ExportTextBoxAsSvg,omitempty"`
136139

@@ -295,6 +298,9 @@ type HtmlSaveOptionsData struct {
295298
// Container class for html save options.
296299
ExportRoundtripInformation *bool `json:"ExportRoundtripInformation,omitempty"`
297300

301+
// Container class for html save options.
302+
ExportShapesAsSvg *bool `json:"ExportShapesAsSvg,omitempty"`
303+
298304
// Container class for html save options.
299305
ExportTextBoxAsSvg *bool `json:"ExportTextBoxAsSvg,omitempty"`
300306

@@ -476,6 +482,8 @@ func (obj *HtmlSaveOptionsData) Initialize() {
476482

477483

478484

485+
486+
479487

480488

481489

dev/api/models/mhtml_save_options_data.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ type MhtmlSaveOptionsDataResult struct {
131131
// Container class for mhtml save options.
132132
ExportRoundtripInformation bool `json:"ExportRoundtripInformation,omitempty"`
133133

134+
// Container class for mhtml save options.
135+
ExportShapesAsSvg bool `json:"ExportShapesAsSvg,omitempty"`
136+
134137
// Container class for mhtml save options.
135138
ExportTextBoxAsSvg bool `json:"ExportTextBoxAsSvg,omitempty"`
136139

@@ -298,6 +301,9 @@ type MhtmlSaveOptionsData struct {
298301
// Container class for mhtml save options.
299302
ExportRoundtripInformation *bool `json:"ExportRoundtripInformation,omitempty"`
300303

304+
// Container class for mhtml save options.
305+
ExportShapesAsSvg *bool `json:"ExportShapesAsSvg,omitempty"`
306+
301307
// Container class for mhtml save options.
302308
ExportTextBoxAsSvg *bool `json:"ExportTextBoxAsSvg,omitempty"`
303309

@@ -488,6 +494,8 @@ func (obj *MhtmlSaveOptionsData) Initialize() {
488494

489495

490496

497+
498+
491499

492500

493501

0 commit comments

Comments
 (0)