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+ }
0 commit comments