Skip to content

Commit 237019b

Browse files
Merge remote-tracking branch 'origin/master' into release
2 parents c8647e5 + 5999f3b commit 237019b

39 files changed

+1464
-103
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [23.12.0] - Aspose Words Cloud for Dart 23.12 Release Notes
2+
3+
- Properties Name, Text, StartRange, EndRange marked as required for InsertBookmark operation.
4+
- Implemented DeleteOfficeMathObjects operation to delete all office math objects from document.
5+
- Parameter ProtectionRequest was removed from the UnprotectDocument operation. Now removing protection from a document does not require a password.
6+
- 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.
7+
8+
19
## [23.11.0] - Aspose Words Cloud for Dart 23.11 Release Notes
210

311
- Support of required properties in models.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Add this dependency to your *pubspec.yaml*:
2727

2828
```yaml
2929
dependencies:
30-
aspose_words_cloud: 23.11.0
30+
aspose_words_cloud: 23.12.0
3131
```
3232
3333
## Getting Started

analysis_options.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
analyzer:
22
exclude:
3-
- test/**
3+
- test/**
4+
- lib/src/models/*.dart
5+
- lib/src/requests/*.dart

lib/aspose_words_cloud.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ export 'src/models/png_save_options_data.dart';
210210
export 'src/models/preferred_width.dart';
211211
export 'src/models/protection_data_response.dart';
212212
export 'src/models/protection_data.dart';
213+
export 'src/models/protection_request_base.dart';
214+
export 'src/models/protection_request_v2.dart';
213215
export 'src/models/protection_request.dart';
214216
export 'src/models/ps_save_options_data.dart';
215217
export 'src/models/public_key_response.dart';
@@ -291,6 +293,9 @@ export 'src/models/tiff_save_options_data.dart';
291293
export 'src/models/time_zone_info_data.dart';
292294
export 'src/models/txt_save_options_base_data.dart';
293295
export 'src/models/user_information.dart';
296+
export 'src/models/watermark_data_base.dart';
297+
export 'src/models/watermark_data_image.dart';
298+
export 'src/models/watermark_data_text.dart';
294299
export 'src/models/watermark_text.dart';
295300
export 'src/models/word_ml_save_options_data.dart';
296301
export 'src/models/words_api_error_response.dart';
@@ -368,6 +373,8 @@ export 'src/requests/delete_macros_online_request.dart';
368373
export 'src/requests/delete_macros_request.dart';
369374
export 'src/requests/delete_office_math_object_online_request.dart';
370375
export 'src/requests/delete_office_math_object_request.dart';
376+
export 'src/requests/delete_office_math_objects_online_request.dart';
377+
export 'src/requests/delete_office_math_objects_request.dart';
371378
export 'src/requests/delete_paragraph_list_format_online_request.dart';
372379
export 'src/requests/delete_paragraph_list_format_request.dart';
373380
export 'src/requests/delete_paragraph_online_request.dart';
@@ -549,6 +556,8 @@ export 'src/requests/insert_table_row_online_request.dart';
549556
export 'src/requests/insert_table_row_request.dart';
550557
export 'src/requests/insert_watermark_image_online_request.dart';
551558
export 'src/requests/insert_watermark_image_request.dart';
559+
export 'src/requests/insert_watermark_online_request.dart';
560+
export 'src/requests/insert_watermark_request.dart';
552561
export 'src/requests/insert_watermark_text_online_request.dart';
553562
export 'src/requests/insert_watermark_text_request.dart';
554563
export 'src/requests/link_header_footers_to_previous_request.dart';
@@ -666,6 +675,7 @@ export 'src/responses/insert_table_cell_online_response.dart';
666675
export 'src/responses/insert_table_online_response.dart';
667676
export 'src/responses/insert_table_row_online_response.dart';
668677
export 'src/responses/insert_watermark_image_online_response.dart';
678+
export 'src/responses/insert_watermark_online_response.dart';
669679
export 'src/responses/insert_watermark_text_online_response.dart';
670680
export 'src/responses/protect_document_online_response.dart';
671681
export 'src/responses/reject_all_revisions_online_response.dart';

lib/src/api_client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ class ApiClient {
503503

504504
var httpRequest = http.Request(requestData.method, Uri.parse(requestData.url));
505505
httpRequest.headers['x-aspose-client'] = 'dart sdk';
506-
httpRequest.headers['x-aspose-client-version'] = '23.11';
506+
httpRequest.headers['x-aspose-client-version'] = '23.12';
507507
httpRequest.headers['Authorization'] = await _getAuthToken();
508508
httpRequest.headers.addAll(requestData.headers);
509509

lib/src/models/bookmark_insert.dart

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,21 @@ library aspose_words_cloud;
3030
import '../../aspose_words_cloud.dart';
3131

3232
/// Represents a bookmark to insert.
33-
class BookmarkInsert extends BookmarkData {
33+
class BookmarkInsert implements ModelBase {
34+
/// Gets or sets the name of the bookmark.
35+
String? _name;
36+
37+
String? get name => _name;
38+
set name(String? val) => _name = val;
39+
40+
41+
/// Gets or sets text, enclosed in the bookmark.
42+
String? _text;
43+
44+
String? get text => _text;
45+
set text(String? val) => _text = val;
46+
47+
3448
/// Gets or sets the link to start bookmark node.
3549
NewDocumentPosition? _startRange;
3650

@@ -51,7 +65,6 @@ class BookmarkInsert extends BookmarkData {
5165
throw ApiException(400, 'Failed to deserialize BookmarkInsert data model.');
5266
}
5367

54-
super.deserialize(json);
5568
if (json.containsKey('Name')) {
5669
name = json['Name'] as String;
5770
} else {
@@ -80,7 +93,14 @@ class BookmarkInsert extends BookmarkData {
8093
@override
8194
Map<String, dynamic> serialize() {
8295
var _result = <String, dynamic>{};
83-
_result.addAll(super.serialize());
96+
if (name != null) {
97+
_result['Name'] = name!;
98+
}
99+
100+
if (text != null) {
101+
_result['Text'] = text!;
102+
}
103+
84104
if (startRange != null) {
85105
_result['StartRange'] = startRange!.serialize();
86106
}
@@ -97,7 +117,22 @@ class BookmarkInsert extends BookmarkData {
97117

98118
@override
99119
void validate() {
100-
super.validate();
120+
if (name == null)
121+
{
122+
throw new ApiException(400, 'Property Name in BookmarkInsert is required.');
123+
}
124+
if (text == null)
125+
{
126+
throw new ApiException(400, 'Property Text in BookmarkInsert is required.');
127+
}
128+
if (startRange == null)
129+
{
130+
throw new ApiException(400, 'Property StartRange in BookmarkInsert is required.');
131+
}
132+
if (endRange == null)
133+
{
134+
throw new ApiException(400, 'Property EndRange in BookmarkInsert is required.');
135+
}
101136

102137
startRange?.validate();
103138

lib/src/models/compare_data.dart

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class CompareData implements ModelBase {
4848
/// Gets or sets the path to document to compare at the server.
4949
String? _comparingWithDocument;
5050

51+
@Deprecated('This field is deprecated and used only for backward compatibility. Please use FileReference instead.')
5152
String? get comparingWithDocument => _comparingWithDocument;
53+
@Deprecated('This field is deprecated and used only for backward compatibility. Please use FileReference instead.')
5254
set comparingWithDocument(String? val) => _comparingWithDocument = val;
5355

5456

@@ -59,6 +61,13 @@ class CompareData implements ModelBase {
5961
set dateTime(DateTime? val) => _dateTime = val;
6062

6163

64+
/// Gets or sets the file reference.
65+
FileReference? _fileReference;
66+
67+
FileReference? get fileReference => _fileReference;
68+
set fileReference(FileReference? val) => _fileReference = val;
69+
70+
6271
/// Gets or sets the result document format.
6372
String? _resultDocumentFormat;
6473

@@ -96,6 +105,12 @@ class CompareData implements ModelBase {
96105
dateTime = null;
97106
}
98107

108+
if (json.containsKey('FileReference')) {
109+
throw ApiException(400, 'File content is not supported for deserialization.');
110+
} else {
111+
fileReference = null;
112+
}
113+
99114
if (json.containsKey('ResultDocumentFormat')) {
100115
resultDocumentFormat = json['ResultDocumentFormat'] as String;
101116
} else {
@@ -122,6 +137,10 @@ class CompareData implements ModelBase {
122137
_result['DateTime'] = dateTime!.toIso8601String();
123138
}
124139

140+
if (fileReference != null) {
141+
_result['FileReference'] = fileReference!.serialize();
142+
}
143+
125144
if (resultDocumentFormat != null) {
126145
_result['ResultDocumentFormat'] = resultDocumentFormat!;
127146
}
@@ -130,6 +149,12 @@ class CompareData implements ModelBase {
130149

131150
@override
132151
void getFilesContent(List<FileReference> resultFilesContent) {
152+
if (fileReference != null)
153+
{
154+
fileReference!.getFilesContent(resultFilesContent);
155+
}
156+
157+
133158
}
134159

135160
@override
@@ -138,16 +163,20 @@ class CompareData implements ModelBase {
138163
{
139164
throw new ApiException(400, 'Property Author in CompareData is required.');
140165
}
141-
if (comparingWithDocument == null)
166+
if (fileReference == null)
142167
{
143-
throw new ApiException(400, 'Property ComparingWithDocument in CompareData is required.');
168+
throw new ApiException(400, 'Property FileReference in CompareData is required.');
144169
}
145170

146171
compareOptions?.validate();
147172

148173

149174

150175

176+
177+
fileReference?.validate();
178+
179+
151180
}
152181
}
153182

lib/src/models/model_base.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ abstract class ModelBase {
206206
'ProtectionData, _': () => ProtectionData(),
207207
'ProtectionDataResponse, _': () => ProtectionDataResponse(),
208208
'ProtectionRequest, _': () => ProtectionRequest(),
209+
'ProtectionRequestV2, _': () => ProtectionRequestV2(),
209210
'PsSaveOptionsData, _': () => PsSaveOptionsData(),
210211
'PublicKeyResponse, _': () => PublicKeyResponse(),
211212
'RangeDocument, _': () => RangeDocument(),
@@ -281,6 +282,8 @@ abstract class ModelBase {
281282
'TiffSaveOptionsData, _': () => TiffSaveOptionsData(),
282283
'TimeZoneInfoData, _': () => TimeZoneInfoData(),
283284
'UserInformation, _': () => UserInformation(),
285+
'WatermarkDataImage, _': () => WatermarkDataImage(),
286+
'WatermarkDataText, _': () => WatermarkDataText(),
284287
'WatermarkText, _': () => WatermarkText(),
285288
'WordMLSaveOptionsData, _': () => WordMLSaveOptionsData(),
286289
'WordsApiErrorResponse, _': () => WordsApiErrorResponse(),

lib/src/models/protection_data.dart

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ import '../../aspose_words_cloud.dart';
3232
/// Container for the data about protection of the document.
3333
class ProtectionData implements ModelBase {
3434
/// Gets or sets type of the protection.
35-
String? _protectionType;
35+
ProtectionData_ProtectionTypeEnum? _protectionType;
3636

37-
String? get protectionType => _protectionType;
38-
set protectionType(String? val) => _protectionType = val;
37+
ProtectionData_ProtectionTypeEnum? get protectionType => _protectionType;
38+
set protectionType(ProtectionData_ProtectionTypeEnum? val) => _protectionType = val;
3939

4040

4141
@override
@@ -45,7 +45,14 @@ class ProtectionData implements ModelBase {
4545
}
4646

4747
if (json.containsKey('ProtectionType')) {
48-
protectionType = json['ProtectionType'] as String;
48+
switch (json['ProtectionType'] as String) {
49+
case 'AllowOnlyRevisions': protectionType = ProtectionData_ProtectionTypeEnum.allowOnlyRevisions; break;
50+
case 'AllowOnlyComments': protectionType = ProtectionData_ProtectionTypeEnum.allowOnlyComments; break;
51+
case 'AllowOnlyFormFields': protectionType = ProtectionData_ProtectionTypeEnum.allowOnlyFormFields; break;
52+
case 'ReadOnly': protectionType = ProtectionData_ProtectionTypeEnum.readOnly; break;
53+
case 'NoProtection': protectionType = ProtectionData_ProtectionTypeEnum.noProtection; break;
54+
default: protectionType = null; break;
55+
}
4956
} else {
5057
protectionType = null;
5158
}
@@ -55,7 +62,14 @@ class ProtectionData implements ModelBase {
5562
Map<String, dynamic> serialize() {
5663
var _result = <String, dynamic>{};
5764
if (protectionType != null) {
58-
_result['ProtectionType'] = protectionType!;
65+
switch (protectionType!) {
66+
case ProtectionData_ProtectionTypeEnum.allowOnlyRevisions: _result['ProtectionType'] = 'AllowOnlyRevisions'; break;
67+
case ProtectionData_ProtectionTypeEnum.allowOnlyComments: _result['ProtectionType'] = 'AllowOnlyComments'; break;
68+
case ProtectionData_ProtectionTypeEnum.allowOnlyFormFields: _result['ProtectionType'] = 'AllowOnlyFormFields'; break;
69+
case ProtectionData_ProtectionTypeEnum.readOnly: _result['ProtectionType'] = 'ReadOnly'; break;
70+
case ProtectionData_ProtectionTypeEnum.noProtection: _result['ProtectionType'] = 'NoProtection'; break;
71+
default: break;
72+
}
5973
}
6074
return _result;
6175
}
@@ -66,7 +80,20 @@ class ProtectionData implements ModelBase {
6680

6781
@override
6882
void validate() {
83+
if (protectionType == null)
84+
{
85+
throw new ApiException(400, 'Property ProtectionType in ProtectionData is required.');
86+
}
6987
}
7088
}
7189

90+
/// Gets or sets type of the protection.
91+
enum ProtectionData_ProtectionTypeEnum
92+
{
93+
allowOnlyRevisions,
94+
allowOnlyComments,
95+
allowOnlyFormFields,
96+
readOnly,
97+
noProtection
98+
}
7299

lib/src/models/protection_request.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ library aspose_words_cloud;
3030
import '../../aspose_words_cloud.dart';
3131

3232
/// Request on changing of protection.
33-
class ProtectionRequest implements ModelBase {
33+
@Deprecated('ProtectionRequest is deprecated and remains for backwards compatibility only.')
34+
class ProtectionRequest extends ProtectionRequestBase {
3435
/// Gets or sets the new password.
3536
String? _newPassword;
3637

@@ -58,6 +59,7 @@ class ProtectionRequest implements ModelBase {
5859
throw ApiException(400, 'Failed to deserialize ProtectionRequest data model.');
5960
}
6061

62+
super.deserialize(json);
6163
if (json.containsKey('NewPassword')) {
6264
newPassword = json['NewPassword'] as String;
6365
} else {
@@ -80,6 +82,7 @@ class ProtectionRequest implements ModelBase {
8082
@override
8183
Map<String, dynamic> serialize() {
8284
var _result = <String, dynamic>{};
85+
_result.addAll(super.serialize());
8386
if (newPassword != null) {
8487
_result['NewPassword'] = newPassword!;
8588
}
@@ -100,6 +103,7 @@ class ProtectionRequest implements ModelBase {
100103

101104
@override
102105
void validate() {
106+
super.validate();
103107
if (password == null)
104108
{
105109
throw new ApiException(400, 'Property Password in ProtectionRequest is required.');

0 commit comments

Comments
 (0)