Skip to content

Commit af86849

Browse files
SDK regenerated by CI server [ci skip]
1 parent 1dff508 commit af86849

7 files changed

+34
-102
lines changed

CHANGELOG.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
## [24.5.0] - Aspose Words Cloud for Dart 24.5 Release Notes
2-
3-
- Added an url parameter to InsertImage / UpdateImage methods. It allows to link to an image from a web URL.
4-
5-
61
## [24.4.0] - Aspose Words Cloud for Dart 24.4 Release Notes
72

83
- Added the 'MergeWithNext' method to merge a section with the next one.

lib/src/requests/insert_drawing_object_online_request.dart

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ class InsertDrawingObjectOnlineRequest implements RequestBase {
4141
/// Drawing object parameters.
4242
final DrawingObjectInsert? drawingObject;
4343

44-
/// The path to the node in the document tree.
45-
final String? nodePath;
46-
4744
/// File with image.
4845
final ByteData? imageFile;
4946

50-
/// The link to the image.
51-
final String? url;
47+
/// The path to the node in the document tree.
48+
final String? nodePath;
5249

5350
/// Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
5451
final String? loadEncoding;
@@ -68,7 +65,7 @@ class InsertDrawingObjectOnlineRequest implements RequestBase {
6865
/// The date and time to use for revisions.
6966
final String? revisionDateTime;
7067

71-
InsertDrawingObjectOnlineRequest(this.document, this.drawingObject, {this.nodePath, this.imageFile, this.url, this.loadEncoding, this.password, this.encryptedPassword, this.destFileName, this.revisionAuthor, this.revisionDateTime});
68+
InsertDrawingObjectOnlineRequest(this.document, this.drawingObject, this.imageFile, {this.nodePath, this.loadEncoding, this.password, this.encryptedPassword, this.destFileName, this.revisionAuthor, this.revisionDateTime});
7269

7370
@override
7471
Future<ApiRequestData> createRequestData(final ApiClient _apiClient) async {
@@ -78,10 +75,6 @@ class InsertDrawingObjectOnlineRequest implements RequestBase {
7875
var _bodyParts = <ApiRequestPart>[];
7976
var _fileContentParts = <FileReference>[];
8077
_path = _path.replaceAll('{nodePath}', _apiClient.serializeToString(nodePath) ?? "");
81-
if (url != null) {
82-
_queryParams['url'] = _apiClient.serializeToString(url) ?? "";
83-
}
84-
8578
if (loadEncoding != null) {
8679
_queryParams['loadEncoding'] = _apiClient.serializeToString(loadEncoding) ?? "";
8780
}
@@ -136,6 +129,9 @@ class InsertDrawingObjectOnlineRequest implements RequestBase {
136129
_bodyParts.add(_formBody);
137130
}
138131
}
132+
else {
133+
throw ApiException(400, 'Parameter imageFile is required.');
134+
}
139135

140136
for (final _fileContentPart in _fileContentParts) {
141137
_fileContentPart.encryptPassword(_apiClient);

lib/src/requests/insert_drawing_object_request.dart

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,11 @@ class InsertDrawingObjectRequest implements RequestBase {
4242
/// Drawing object parameters.
4343
final DrawingObjectInsert? drawingObject;
4444

45-
/// The path to the node in the document tree.
46-
final String? nodePath;
47-
4845
/// File with image.
4946
final ByteData? imageFile;
5047

51-
/// The link to the image.
52-
final String? url;
48+
/// The path to the node in the document tree.
49+
final String? nodePath;
5350

5451
/// Original document folder.
5552
final String? folder;
@@ -75,7 +72,7 @@ class InsertDrawingObjectRequest implements RequestBase {
7572
/// The date and time to use for revisions.
7673
final String? revisionDateTime;
7774

78-
InsertDrawingObjectRequest(this.name, this.drawingObject, {this.nodePath, this.imageFile, this.url, this.folder, this.storage, this.loadEncoding, this.password, this.encryptedPassword, this.destFileName, this.revisionAuthor, this.revisionDateTime});
75+
InsertDrawingObjectRequest(this.name, this.drawingObject, this.imageFile, {this.nodePath, this.folder, this.storage, this.loadEncoding, this.password, this.encryptedPassword, this.destFileName, this.revisionAuthor, this.revisionDateTime});
7976

8077
@override
8178
Future<ApiRequestData> createRequestData(final ApiClient _apiClient) async {
@@ -89,10 +86,6 @@ class InsertDrawingObjectRequest implements RequestBase {
8986
}
9087
_path = _path.replaceAll('{name}', _apiClient.serializeToString(name) ?? "");
9188
_path = _path.replaceAll('{nodePath}', _apiClient.serializeToString(nodePath) ?? "");
92-
if (url != null) {
93-
_queryParams['url'] = _apiClient.serializeToString(url) ?? "";
94-
}
95-
9689
if (folder != null) {
9790
_queryParams['folder'] = _apiClient.serializeToString(folder) ?? "";
9891
}
@@ -144,6 +137,9 @@ class InsertDrawingObjectRequest implements RequestBase {
144137
_bodyParts.add(_formBody);
145138
}
146139
}
140+
else {
141+
throw ApiException(400, 'Parameter imageFile is required.');
142+
}
147143

148144
for (final _fileContentPart in _fileContentParts) {
149145
_fileContentPart.encryptPassword(_apiClient);

lib/src/requests/update_drawing_object_online_request.dart

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,15 @@ class UpdateDrawingObjectOnlineRequest implements RequestBase {
4141
/// Drawing object parameters.
4242
final DrawingObjectUpdate? drawingObject;
4343

44+
/// File with image.
45+
final ByteData? imageFile;
46+
4447
/// Object index.
4548
final int? index;
4649

4750
/// The path to the node in the document tree.
4851
final String? nodePath;
4952

50-
/// File with image.
51-
final ByteData? imageFile;
52-
53-
/// The link to the image.
54-
final String? url;
55-
5653
/// Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
5754
final String? loadEncoding;
5855

@@ -71,7 +68,7 @@ class UpdateDrawingObjectOnlineRequest implements RequestBase {
7168
/// The date and time to use for revisions.
7269
final String? revisionDateTime;
7370

74-
UpdateDrawingObjectOnlineRequest(this.document, this.drawingObject, this.index, {this.nodePath, this.imageFile, this.url, this.loadEncoding, this.password, this.encryptedPassword, this.destFileName, this.revisionAuthor, this.revisionDateTime});
71+
UpdateDrawingObjectOnlineRequest(this.document, this.drawingObject, this.imageFile, this.index, {this.nodePath, this.loadEncoding, this.password, this.encryptedPassword, this.destFileName, this.revisionAuthor, this.revisionDateTime});
7572

7673
@override
7774
Future<ApiRequestData> createRequestData(final ApiClient _apiClient) async {
@@ -85,10 +82,6 @@ class UpdateDrawingObjectOnlineRequest implements RequestBase {
8582
}
8683
_path = _path.replaceAll('{index}', _apiClient.serializeToString(index) ?? "");
8784
_path = _path.replaceAll('{nodePath}', _apiClient.serializeToString(nodePath) ?? "");
88-
if (url != null) {
89-
_queryParams['url'] = _apiClient.serializeToString(url) ?? "";
90-
}
91-
9285
if (loadEncoding != null) {
9386
_queryParams['loadEncoding'] = _apiClient.serializeToString(loadEncoding) ?? "";
9487
}
@@ -143,6 +136,9 @@ class UpdateDrawingObjectOnlineRequest implements RequestBase {
143136
_bodyParts.add(_formBody);
144137
}
145138
}
139+
else {
140+
throw ApiException(400, 'Parameter imageFile is required.');
141+
}
146142

147143
for (final _fileContentPart in _fileContentParts) {
148144
_fileContentPart.encryptPassword(_apiClient);

lib/src/requests/update_drawing_object_request.dart

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,15 @@ class UpdateDrawingObjectRequest implements RequestBase {
4242
/// Drawing object parameters.
4343
final DrawingObjectUpdate? drawingObject;
4444

45+
/// File with image.
46+
final ByteData? imageFile;
47+
4548
/// Object index.
4649
final int? index;
4750

4851
/// The path to the node in the document tree.
4952
final String? nodePath;
5053

51-
/// File with image.
52-
final ByteData? imageFile;
53-
54-
/// The link to the image.
55-
final String? url;
56-
5754
/// Original document folder.
5855
final String? folder;
5956

@@ -78,7 +75,7 @@ class UpdateDrawingObjectRequest implements RequestBase {
7875
/// The date and time to use for revisions.
7976
final String? revisionDateTime;
8077

81-
UpdateDrawingObjectRequest(this.name, this.drawingObject, this.index, {this.nodePath, this.imageFile, this.url, this.folder, this.storage, this.loadEncoding, this.password, this.encryptedPassword, this.destFileName, this.revisionAuthor, this.revisionDateTime});
78+
UpdateDrawingObjectRequest(this.name, this.drawingObject, this.imageFile, this.index, {this.nodePath, this.folder, this.storage, this.loadEncoding, this.password, this.encryptedPassword, this.destFileName, this.revisionAuthor, this.revisionDateTime});
8279

8380
@override
8481
Future<ApiRequestData> createRequestData(final ApiClient _apiClient) async {
@@ -97,10 +94,6 @@ class UpdateDrawingObjectRequest implements RequestBase {
9794
}
9895
_path = _path.replaceAll('{index}', _apiClient.serializeToString(index) ?? "");
9996
_path = _path.replaceAll('{nodePath}', _apiClient.serializeToString(nodePath) ?? "");
100-
if (url != null) {
101-
_queryParams['url'] = _apiClient.serializeToString(url) ?? "";
102-
}
103-
10497
if (folder != null) {
10598
_queryParams['folder'] = _apiClient.serializeToString(folder) ?? "";
10699
}
@@ -152,6 +145,9 @@ class UpdateDrawingObjectRequest implements RequestBase {
152145
_bodyParts.add(_formBody);
153146
}
154147
}
148+
else {
149+
throw ApiException(400, 'Parameter imageFile is required.');
150+
}
155151

156152
for (final _fileContentPart in _fileContentParts) {
157153
_fileContentPart.encryptPassword(_apiClient);

test/aspose_words_cloud_tests.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,12 @@ void main() {
270270
test('InsertDrawingObject', () async => await DrawingObjectsTests(testContext).testInsertDrawingObject());
271271
test('InsertDrawingObjectOnline', () async => await DrawingObjectsTests(testContext).testInsertDrawingObjectOnline());
272272
test('InsertDrawingObjectWithoutNodePath', () async => await DrawingObjectsTests(testContext).testInsertDrawingObjectWithoutNodePath());
273-
test('InsertDrawingObjectLink', () async => await DrawingObjectsTests(testContext).testInsertDrawingObjectLink());
274273
test('DeleteDrawingObject', () async => await DrawingObjectsTests(testContext).testDeleteDrawingObject());
275274
test('DeleteDrawingObjectOnline', () async => await DrawingObjectsTests(testContext).testDeleteDrawingObjectOnline());
276275
test('DeleteDrawingObjectWithoutNodePath', () async => await DrawingObjectsTests(testContext).testDeleteDrawingObjectWithoutNodePath());
277276
test('UpdateDrawingObject', () async => await DrawingObjectsTests(testContext).testUpdateDrawingObject());
278277
test('UpdateDrawingObjectOnline', () async => await DrawingObjectsTests(testContext).testUpdateDrawingObjectOnline());
279278
test('UpdateDrawingObjectWithoutNodePath', () async => await DrawingObjectsTests(testContext).testUpdateDrawingObjectWithoutNodePath());
280-
test('UpdateDrawingObjectLink', () async => await DrawingObjectsTests(testContext).testUpdateDrawingObjectLink());
281279
});
282280

283281
group('Field', () {

test/drawing/drawing_objects_tests.dart

Lines changed: 8 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ class DrawingObjectsTests
287287
final request = InsertDrawingObjectRequest(
288288
remoteFileName,
289289
requestDrawingObject,
290+
requestImageFile,
290291
nodePath: '',
291-
imageFile: requestImageFile,
292292
folder: remoteDataFolder
293293
);
294294

@@ -314,8 +314,8 @@ class DrawingObjectsTests
314314
final request = InsertDrawingObjectOnlineRequest(
315315
requestDocument,
316316
requestDrawingObject,
317-
nodePath: '',
318-
imageFile: requestImageFile
317+
requestImageFile,
318+
nodePath: ''
319319
);
320320

321321
await context.getApi().insertDrawingObjectOnline(request);
@@ -340,32 +340,7 @@ class DrawingObjectsTests
340340
final request = InsertDrawingObjectRequest(
341341
remoteFileName,
342342
requestDrawingObject,
343-
imageFile: requestImageFile,
344-
folder: remoteDataFolder
345-
);
346-
347-
await context.getApi().insertDrawingObject(request);
348-
}
349-
350-
/// Test for adding a link to a drawing object.
351-
Future<void> testInsertDrawingObjectLink() async
352-
{
353-
final remoteFileName = 'TestInsetDrawingObject.docx';
354-
await context.uploadFile(localFile, remoteDataFolder + '/' + remoteFileName);
355-
final requestDrawingObject = DrawingObjectInsert();
356-
requestDrawingObject.height = 0;
357-
requestDrawingObject.left = 0;
358-
requestDrawingObject.top = 0;
359-
requestDrawingObject.width = 0;
360-
requestDrawingObject.relativeHorizontalPosition = DrawingObjectInsert_RelativeHorizontalPositionEnum.margin;
361-
requestDrawingObject.relativeVerticalPosition = DrawingObjectInsert_RelativeVerticalPositionEnum.margin;
362-
requestDrawingObject.wrapType = DrawingObjectInsert_WrapTypeEnum.inline;
363-
364-
final request = InsertDrawingObjectRequest(
365-
remoteFileName,
366-
requestDrawingObject,
367-
nodePath: '',
368-
url: 'https://products.aspose.com/words/static/img/aspose_words_cloud-for-net.png',
343+
requestImageFile,
369344
folder: remoteDataFolder
370345
);
371346

@@ -430,9 +405,9 @@ class DrawingObjectsTests
430405
final request = UpdateDrawingObjectRequest(
431406
remoteFileName,
432407
requestDrawingObject,
408+
requestImageFile,
433409
0,
434410
nodePath: '',
435-
imageFile: requestImageFile,
436411
folder: remoteDataFolder
437412
);
438413

@@ -452,9 +427,9 @@ class DrawingObjectsTests
452427
final request = UpdateDrawingObjectOnlineRequest(
453428
requestDocument,
454429
requestDrawingObject,
430+
requestImageFile,
455431
0,
456-
nodePath: '',
457-
imageFile: requestImageFile
432+
nodePath: ''
458433
);
459434

460435
await context.getApi().updateDrawingObjectOnline(request);
@@ -473,28 +448,8 @@ class DrawingObjectsTests
473448
final request = UpdateDrawingObjectRequest(
474449
remoteFileName,
475450
requestDrawingObject,
451+
requestImageFile,
476452
0,
477-
imageFile: requestImageFile,
478-
folder: remoteDataFolder
479-
);
480-
481-
await context.getApi().updateDrawingObject(request);
482-
}
483-
484-
/// Test for updating drawing object to a link to it.
485-
Future<void> testUpdateDrawingObjectLink() async
486-
{
487-
final remoteFileName = 'TestUpdateDrawingObjectLink.docx';
488-
await context.uploadFile(localFile, remoteDataFolder + '/' + remoteFileName);
489-
final requestDrawingObject = DrawingObjectUpdate();
490-
requestDrawingObject.left = 0;
491-
492-
final request = UpdateDrawingObjectRequest(
493-
remoteFileName,
494-
requestDrawingObject,
495-
0,
496-
nodePath: '',
497-
url: 'https://products.aspose.com/words/static/img/aspose_words_cloud-for-net.png',
498453
folder: remoteDataFolder
499454
);
500455

0 commit comments

Comments
 (0)