Skip to content

Commit 46ab157

Browse files
Merge remote-tracking branch 'origin/master' into release
2 parents 994e047 + f2125f7 commit 46ab157

File tree

839 files changed

+166404
-114
lines changed

Some content is hidden

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

839 files changed

+166404
-114
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ 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 23.12
20+
21+
- Properties Name, Text, StartRange, EndRange marked as required for InsertBookmark operation.
22+
- Implemented DeleteOfficeMathObjects operation to delete all office math objects from document.
23+
- Parameter ProtectionRequest was removed from the UnprotectDocument operation. Now removing protection from a document does not require a password.
24+
- Model ProtectionRequest marked as deprecated, please use ProtectionRequestV2 instead for perform ProtectDocument operation. To change the password or protection type of protected document, the old password is no required.
25+
26+
1927
## Enhancements in Version 23.11
2028

2129
- Support of required properties in models.

dev/api/api_client.go

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

68-
// APIClient manages communication with the Aspose.Words for Cloud API Reference API v23.11
68+
// APIClient manages communication with the Aspose.Words for Cloud API Reference API v23.12
6969
// In most cases there should be only one, shared, APIClient.
7070
type APIClient struct {
7171
cfg *models.Configuration

dev/api/models/bookmark_insert.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ func (BookmarkInsert) IsBookmarkInsert() bool {
6767
return true
6868
}
6969

70-
func (BookmarkInsert) IsBookmarkData() bool {
71-
return true
72-
}
7370

7471
func (obj *BookmarkInsert) Initialize() {
7572
if (obj.StartRange != nil) {
@@ -150,6 +147,18 @@ func (obj *BookmarkInsert) Validate() error {
150147
return errors.New("Invalid object.")
151148
}
152149

150+
if obj.Name == nil {
151+
return errors.New("Property Name in BookmarkInsert is required.")
152+
}
153+
if obj.Text == nil {
154+
return errors.New("Property Text in BookmarkInsert is required.")
155+
}
156+
if obj.StartRange == nil {
157+
return errors.New("Property StartRange in BookmarkInsert is required.")
158+
}
159+
if obj.EndRange == nil {
160+
return errors.New("Property EndRange in BookmarkInsert is required.")
161+
}
153162
if obj.StartRange != nil {
154163
if err := obj.StartRange.Validate(); err != nil {
155164
return err

dev/api/models/compare_data.go

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ type ICompareData interface {
4747
SetComparingWithDocument(value *string)
4848
GetDateTime() *Time
4949
SetDateTime(value *Time)
50+
GetFileReference() IFileReference
51+
SetFileReference(value IFileReference)
5052
GetResultDocumentFormat() *string
5153
SetResultDocumentFormat(value *string)
5254
}
@@ -64,6 +66,9 @@ type CompareData struct {
6466
// Container class for compare documents.
6567
DateTime *Time `json:"DateTime,omitempty"`
6668

69+
// Container class for compare documents.
70+
FileReference IFileReference `json:"FileReference,omitempty"`
71+
6772
// Container class for compare documents.
6873
ResultDocumentFormat *string `json:"ResultDocumentFormat,omitempty"`
6974
}
@@ -78,6 +83,10 @@ func (obj *CompareData) Initialize() {
7883
obj.CompareOptions.Initialize()
7984
}
8085

86+
if (obj.FileReference != nil) {
87+
obj.FileReference.Initialize()
88+
}
89+
8190

8291
}
8392

@@ -136,6 +145,22 @@ func (obj *CompareData) Deserialize(json map[string]interface{}) {
136145

137146
}
138147

148+
if jsonValue, exists := json["FileReference"]; exists {
149+
if parsedValue, valid := jsonValue.(map[string]interface{}); valid {
150+
var modelInstance IFileReference = new(FileReference)
151+
modelInstance.Deserialize(parsedValue)
152+
obj.FileReference = modelInstance
153+
}
154+
155+
} else if jsonValue, exists := json["fileReference"]; exists {
156+
if parsedValue, valid := jsonValue.(map[string]interface{}); valid {
157+
var modelInstance IFileReference = new(FileReference)
158+
modelInstance.Deserialize(parsedValue)
159+
obj.FileReference = modelInstance
160+
}
161+
162+
}
163+
139164
if jsonValue, exists := json["ResultDocumentFormat"]; exists {
140165
if parsedValue, valid := jsonValue.(string); valid {
141166
obj.ResultDocumentFormat = &parsedValue
@@ -150,6 +175,11 @@ func (obj *CompareData) Deserialize(json map[string]interface{}) {
150175
}
151176

152177
func (obj *CompareData) CollectFilesContent(resultFilesContent []FileReference) []FileReference {
178+
if (obj.FileReference != nil) {
179+
resultFilesContent = obj.FileReference.CollectFilesContent(resultFilesContent)
180+
}
181+
182+
153183
return resultFilesContent
154184
}
155185

@@ -161,14 +191,19 @@ func (obj *CompareData) Validate() error {
161191
if obj.Author == nil {
162192
return errors.New("Property Author in CompareData is required.")
163193
}
164-
if obj.ComparingWithDocument == nil {
165-
return errors.New("Property ComparingWithDocument in CompareData is required.")
194+
if obj.FileReference == nil {
195+
return errors.New("Property FileReference in CompareData is required.")
166196
}
167197
if obj.CompareOptions != nil {
168198
if err := obj.CompareOptions.Validate(); err != nil {
169199
return err
170200
}
171201
}
202+
if obj.FileReference != nil {
203+
if err := obj.FileReference.Validate(); err != nil {
204+
return err
205+
}
206+
}
172207

173208
return nil;
174209
}
@@ -205,6 +240,14 @@ func (obj *CompareData) SetDateTime(value *Time) {
205240
obj.DateTime = value
206241
}
207242

243+
func (obj *CompareData) GetFileReference() IFileReference {
244+
return obj.FileReference
245+
}
246+
247+
func (obj *CompareData) SetFileReference(value IFileReference) {
248+
obj.FileReference = value
249+
}
250+
208251
func (obj *CompareData) GetResultDocumentFormat() *string {
209252
return obj.ResultDocumentFormat
210253
}

dev/api/models/compare_document_online_request.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ type CompareDocumentOnlineRequest struct {
4444
// Compare data.
4545
CompareData ICompareData
4646
/* optional (nil or map[string]interface{}) with one or more of key / value pairs:
47-
key: "comparingDocument" value: (io.ReadCloser) The comparing document.
4847
key: "loadEncoding" value: (*string) Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
4948
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.
5049
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.
@@ -142,17 +141,7 @@ func (data *CompareDocumentOnlineRequest) CreateRequestData() (RequestData, erro
142141
}
143142

144143
result.FormParams = append(result.FormParams, NewJsonFormParamContainer("CompareData", parameterToString(data.CompareData, "")))
145-
146-
var comparingDocument (io.ReadCloser)
147-
if localVarTempParam, localVarOk := data.Optionals["comparingDocument"].(io.ReadCloser); localVarOk {
148-
comparingDocument = localVarTempParam
149-
}
150-
_comparingDocument := comparingDocument
151-
if _comparingDocument != nil {
152-
fbs, _ := ioutil.ReadAll(_comparingDocument)
153-
_comparingDocument.Close()
154-
result.FormParams = append(result.FormParams, NewFileFormParamContainer("comparingDocument", fbs))
155-
}
144+
filesContentData = data.CompareData.CollectFilesContent(filesContentData)
156145

157146

158147
for _, fileContentData := range filesContentData {

dev/api/models/compare_document_request.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ func (data *CompareDocumentRequest) CreateRequestData() (RequestData, error) {
153153

154154

155155
result.FormParams = append(result.FormParams, NewJsonFormParamContainer("CompareData", parameterToString(data.CompareData, "")))
156+
filesContentData = data.CompareData.CollectFilesContent(filesContentData)
156157

157158

158159
for _, fileContentData := range filesContentData {

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": "23.11"},
102+
DefaultHeader: map[string]string{"x-aspose-client": "go sdk", "x-aspose-client-version": "23.12"},
103103
}
104104
err = json.Unmarshal(data, &cfg)
105105

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="delete_office_math_objects_online_request.go">
4+
* Copyright (c) 2023 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+
"errors"
32+
"io/ioutil"
33+
"net/url"
34+
"strings"
35+
"io"
36+
)
37+
38+
// DeleteOfficeMathObjectsOnlineRequest contains request data for WordsApiService.DeleteOfficeMathObjectsOnline method.
39+
type DeleteOfficeMathObjectsOnlineRequest struct {
40+
// The document.
41+
Document io.ReadCloser
42+
/* optional (nil or map[string]interface{}) with one or more of key / value pairs:
43+
key: "loadEncoding" value: (*string) Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
44+
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.
45+
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.
46+
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.
47+
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.
48+
key: "revisionDateTime" value: (*string) The date and time to use for revisions. */
49+
Optionals map[string]interface{}
50+
}
51+
52+
53+
func (data *DeleteOfficeMathObjectsOnlineRequest) CreateRequestData() (RequestData, error) {
54+
var result RequestData
55+
var filesContentData = make([]FileReference, 0)
56+
if data == nil {
57+
return result, errors.New("Invalid object.")
58+
}
59+
60+
result.Method = strings.ToUpper("put")
61+
62+
// create path and map variables
63+
result.Path = "/words/online/delete/OfficeMathObjects"
64+
65+
result.Path = strings.Replace(result.Path, "/<nil>", "", -1)
66+
result.Path = strings.Replace(result.Path, "//", "/", -1)
67+
68+
result.HeaderParams = make(map[string]string)
69+
result.QueryParams = url.Values{}
70+
result.FormParams = make([]FormParamContainer, 0)
71+
72+
if (data.Document == nil) {
73+
return result, errors.New("Parameter Document is required.")
74+
}
75+
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+
if err := typeCheckParameter(data.Optionals["revisionAuthor"], "string", "data.Optionals[revisionAuthor]"); err != nil {
90+
return result, err
91+
}
92+
if err := typeCheckParameter(data.Optionals["revisionDateTime"], "string", "data.Optionals[revisionDateTime]"); err != nil {
93+
return result, err
94+
}
95+
96+
97+
98+
if localVarTempParam, localVarOk := data.Optionals["loadEncoding"].(string); localVarOk {
99+
result.QueryParams.Add("LoadEncoding", parameterToString(localVarTempParam, ""))
100+
}
101+
102+
103+
if localVarTempParam, localVarOk := data.Optionals["password"].(string); localVarOk {
104+
result.QueryParams.Add("Password", parameterToString(localVarTempParam, ""))
105+
}
106+
107+
108+
if localVarTempParam, localVarOk := data.Optionals["encryptedPassword"].(string); localVarOk {
109+
result.QueryParams.Add("EncryptedPassword", parameterToString(localVarTempParam, ""))
110+
}
111+
112+
113+
if localVarTempParam, localVarOk := data.Optionals["destFileName"].(string); localVarOk {
114+
result.QueryParams.Add("DestFileName", parameterToString(localVarTempParam, ""))
115+
}
116+
117+
118+
if localVarTempParam, localVarOk := data.Optionals["revisionAuthor"].(string); localVarOk {
119+
result.QueryParams.Add("RevisionAuthor", parameterToString(localVarTempParam, ""))
120+
}
121+
122+
123+
if localVarTempParam, localVarOk := data.Optionals["revisionDateTime"].(string); localVarOk {
124+
result.QueryParams.Add("RevisionDateTime", parameterToString(localVarTempParam, ""))
125+
}
126+
127+
128+
129+
_document := data.Document
130+
if _document != nil {
131+
fbs, _ := ioutil.ReadAll(_document)
132+
_document.Close()
133+
result.FormParams = append(result.FormParams, NewFileFormParamContainer("document", fbs))
134+
}
135+
136+
137+
for _, fileContentData := range filesContentData {
138+
fbs, _ := ioutil.ReadAll(fileContentData.Content)
139+
result.FormParams = append(result.FormParams, NewFileFormParamContainer(fileContentData.Reference, fbs))
140+
}
141+
142+
return result, nil
143+
}
144+
145+
func (data *DeleteOfficeMathObjectsOnlineRequest) CreateResponse(reader io.Reader, boundary string) (response interface{}, err error) {
146+
var successPayload map[string]io.Reader
147+
successPayload, err = ParseReadCloserFilesCollection(reader, boundary)
148+
return successPayload, err
149+
}

0 commit comments

Comments
 (0)