Skip to content

Commit 4e16387

Browse files
Merge remote-tracking branch 'origin/master' into release
2 parents bf9ea11 + dbc50ff commit 4e16387

File tree

9 files changed

+179
-3
lines changed

9 files changed

+179
-3
lines changed

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: 25.9.0
30+
aspose_words_cloud: 25.10.0
3131
```
3232
3333
## Getting Started

lib/aspose_words_cloud.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ export 'src/requests/insert_watermark_request.dart';
582582
export 'src/requests/insert_watermark_text_online_request.dart';
583583
export 'src/requests/insert_watermark_text_request.dart';
584584
export 'src/requests/link_header_footers_to_previous_request.dart';
585+
export 'src/requests/load_web_document_online_request.dart';
585586
export 'src/requests/load_web_document_request.dart';
586587
export 'src/requests/merge_with_next_online_request.dart';
587588
export 'src/requests/merge_with_next_request.dart';
@@ -706,6 +707,7 @@ export 'src/responses/insert_table_row_online_response.dart';
706707
export 'src/responses/insert_watermark_image_online_response.dart';
707708
export 'src/responses/insert_watermark_online_response.dart';
708709
export 'src/responses/insert_watermark_text_online_response.dart';
710+
export 'src/responses/load_web_document_online_response.dart';
709711
export 'src/responses/protect_document_online_response.dart';
710712
export 'src/responses/reject_all_revisions_online_response.dart';
711713
export 'src/responses/remove_all_signatures_online_response.dart';

lib/src/api_client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class ApiClient {
518518
}
519519

520520
httpRequest.headers['x-aspose-client'] = 'dart sdk';
521-
httpRequest.headers['x-aspose-client-version'] = '25.9';
521+
httpRequest.headers['x-aspose-client-version'] = '25.10';
522522
httpRequest.headers['Authorization'] = await _getAuthToken();
523523
httpRequest.headers.addAll(requestData.headers);
524524

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="load_web_document_online_request.dart">
4+
* Copyright (c) 2025 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+
library aspose_words_cloud;
29+
30+
import 'dart:typed_data';
31+
import '../../aspose_words_cloud.dart';
32+
import '../api_client.dart';
33+
import '../api_request_data.dart';
34+
import '../api_request_part.dart';
35+
36+
/// Request model for LoadWebDocumentOnline operation.
37+
class LoadWebDocumentOnlineRequest implements RequestBase {
38+
/// The properties of data downloading.
39+
final LoadWebDocumentData? data;
40+
41+
/// Request send data progress callback
42+
final SendDataProgressCallback? sendDataProgressCallback;
43+
44+
/// Response receive data progress callback
45+
final ReceiveDataProgressCallback? receiveDataProgressCallback;
46+
47+
LoadWebDocumentOnlineRequest(this.data, { this.sendDataProgressCallback, this.receiveDataProgressCallback });
48+
49+
@override
50+
Future<ApiRequestData> createRequestData(final ApiClient _apiClient) async {
51+
var _path = '/words/online/put/loadWebDocument';
52+
var _queryParams = <String, String>{};
53+
var _headers = <String, String>{};
54+
var _bodyParts = <ApiRequestPart>[];
55+
var _fileContentParts = <FileReference>[];
56+
if (data != null) {
57+
data!.validate();
58+
59+
var _formBody = _apiClient.serializeBody(data, 'Data');
60+
if (_formBody != null) {
61+
_bodyParts.add(_formBody);
62+
}
63+
}
64+
else {
65+
throw ApiException(400, 'Parameter data is required.');
66+
}
67+
68+
for (final _fileContentPart in _fileContentParts) {
69+
_fileContentPart.encryptPassword(_apiClient);
70+
if (_fileContentPart.source == 'Request') {
71+
_bodyParts.add(ApiRequestPart(_fileContentPart.content!, 'application/octet-stream', name: _fileContentPart.reference));
72+
}
73+
}
74+
var _url = _apiClient.configuration.getApiRootUrl() + _apiClient.applyQueryParams(_path, _queryParams).replaceAll('//', '/');
75+
var _body = _apiClient.serializeBodyParts(_bodyParts, _headers);
76+
return ApiRequestData('PUT', _url, _headers, _body, this.sendDataProgressCallback, this.receiveDataProgressCallback);
77+
}
78+
79+
@override
80+
dynamic deserializeResponse(final ApiClient _apiClient, final Map<String, String> _headers, final ByteData? _body) {
81+
if (_body == null) {
82+
return ApiException(400, "Nullable response body is not allowed for this operation type.");
83+
}
84+
85+
var _result = LoadWebDocumentOnlineResponse();
86+
_result.deserialize(_apiClient, _apiClient.deserializeMultipartMap(_body));
87+
return _result;
88+
}
89+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="load_web_document_online_response.dart">
4+
* Copyright (c) 2025 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+
library aspose_words_cloud;
29+
30+
import 'dart:convert';
31+
import 'dart:typed_data';
32+
33+
import '../../aspose_words_cloud.dart';
34+
import '../api_client.dart';
35+
import '../body_part_data.dart';
36+
37+
/// Downloads a document from the Web using URL and saves it to cloud storage in the specified format.
38+
class LoadWebDocumentOnlineResponse implements ResponseBase {
39+
/// The REST response with a save result.
40+
SaveResponse? model;
41+
42+
/// The document after modification.
43+
Map<String, ByteData>? document;
44+
45+
@override
46+
void deserialize(ApiClient apiClient, Map<String, BodyPartData> _parts) {
47+
final _modelBody = _parts['model'];
48+
if (_modelBody != null) {
49+
final _modelJsonData = utf8.decode(_modelBody.content.buffer.asUint8List(_modelBody.content.offsetInBytes, _modelBody.content.lengthInBytes));
50+
model = ModelBase.createInstance< SaveResponse >(jsonDecode(_modelJsonData) as Map<String, dynamic>);
51+
}
52+
53+
final _documentFile = _parts['document'];
54+
if (_documentFile != null) {
55+
document = apiClient.deserializeFilesCollection(_documentFile);
56+
}
57+
}
58+
}
59+

lib/src/words_api.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,11 @@ class WordsApi {
13421342
return await _apiClient.call(request) as SaveResponse;
13431343
}
13441344

1345+
/// Downloads a document from the Web using URL and saves it to cloud storage in the specified format.
1346+
Future< LoadWebDocumentOnlineResponse > loadWebDocumentOnline(LoadWebDocumentOnlineRequest request) async {
1347+
return await _apiClient.call(request) as LoadWebDocumentOnlineResponse;
1348+
}
1349+
13451350
/// Merge the section with the next one.
13461351
Future< void > mergeWithNext(MergeWithNextRequest request) async {
13471352
await _apiClient.call(request);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: aspose_words_cloud
22
description: This package allows you to work with Aspose.Words Cloud REST APIs in your Dart applications quickly and easily, with zero initial cost.
3-
version: 25.9.0
3+
version: 25.10.0
44
homepage: https://github.com/aspose-words-cloud/aspose-words-cloud-dart
55

66
environment:

test/aspose_words_cloud_tests.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ void main() {
215215

216216
group('LoadWebDocument', () {
217217
test('LoadWebDocument', () async => await LoadWebDocumentTests(testContext).testLoadWebDocument());
218+
test('LoadWebDocumentOnline', () async => await LoadWebDocumentTests(testContext).testLoadWebDocumentOnline());
218219
});
219220

220221
group('PasswordEncryption', () {

test/document/load_web_document_tests.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,24 @@ class LoadWebDocumentTests
5959
expect(result.saveResult?.destDocument, isNotNull);
6060
expect(result.saveResult?.destDocument?.href, 'google.doc');
6161
}
62+
63+
/// Test for loading web document online.
64+
Future<void> testLoadWebDocumentOnline() async
65+
{
66+
final requestDataSaveOptions = DocSaveOptionsData();
67+
requestDataSaveOptions.fileName = 'google.doc';
68+
requestDataSaveOptions.dmlEffectsRenderingMode = SaveOptionsData_DmlEffectsRenderingModeEnum.none;
69+
requestDataSaveOptions.dmlRenderingMode = SaveOptionsData_DmlRenderingModeEnum.drawingML;
70+
requestDataSaveOptions.zipOutput = false;
71+
72+
final requestData = LoadWebDocumentData();
73+
requestData.loadingDocumentUrl = 'http://google.com';
74+
requestData.saveOptions = requestDataSaveOptions;
75+
76+
final request = LoadWebDocumentOnlineRequest(
77+
requestData
78+
);
79+
80+
await context.getApi().loadWebDocumentOnline(request);
81+
}
6282
}

0 commit comments

Comments
 (0)