-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into release
- Loading branch information
Showing
13 changed files
with
411 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* -------------------------------------------------------------------------------- | ||
* <copyright company="Aspose" file="translate_node_id_response.dart"> | ||
* Copyright (c) 2024 Aspose.Words for Cloud | ||
* </copyright> | ||
* <summary> | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* </summary> | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
|
||
library aspose_words_cloud; | ||
|
||
import '../../aspose_words_cloud.dart'; | ||
|
||
/// The REST response with a node path. | ||
/// This response is returned by the Service when handling "GET https://api.aspose.cloud/v4.0/words/Test.doc/translate/{0}" REST API requests. | ||
class TranslateNodeIdResponse extends WordsResponse { | ||
/// Gets or sets the node path. | ||
String? _path; | ||
|
||
String? get path => _path; | ||
set path(String? val) => _path = val; | ||
|
||
|
||
@override | ||
void deserialize(Map<String, dynamic>? json) { | ||
if (json == null) { | ||
throw ApiException(400, 'Failed to deserialize TranslateNodeIdResponse data model.'); | ||
} | ||
|
||
super.deserialize(json); | ||
if (json.containsKey('RequestId')) { | ||
requestId = json['RequestId'] as String; | ||
} else { | ||
requestId = null; | ||
} | ||
|
||
if (json.containsKey('Path')) { | ||
path = json['Path'] as String; | ||
} else { | ||
path = null; | ||
} | ||
} | ||
|
||
@override | ||
Map<String, dynamic> serialize() { | ||
var _result = <String, dynamic>{}; | ||
_result.addAll(super.serialize()); | ||
if (path != null) { | ||
_result['Path'] = path!; | ||
} | ||
return _result; | ||
} | ||
|
||
@override | ||
void getFilesContent(List<FileReference> resultFilesContent) { | ||
} | ||
|
||
@override | ||
void validate() { | ||
super.validate(); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* -------------------------------------------------------------------------------- | ||
* <copyright company="Aspose" file="translate_node_id_online_request.dart"> | ||
* Copyright (c) 2024 Aspose.Words for Cloud | ||
* </copyright> | ||
* <summary> | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* </summary> | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
|
||
library aspose_words_cloud; | ||
|
||
import 'dart:convert'; | ||
import 'dart:typed_data'; | ||
import '../../aspose_words_cloud.dart'; | ||
import '../api_client.dart'; | ||
import '../api_request_data.dart'; | ||
import '../api_request_part.dart'; | ||
|
||
/// Request model for TranslateNodeIdOnline operation. | ||
class TranslateNodeIdOnlineRequest implements RequestBase { | ||
/// The document. | ||
final ByteData? document; | ||
|
||
/// The node identifier. Identifier examples: id0.0.0. | ||
final String? nodeId; | ||
|
||
/// Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML. | ||
final String? loadEncoding; | ||
|
||
/// 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. | ||
final String? password; | ||
|
||
/// Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details. | ||
final String? encryptedPassword; | ||
|
||
TranslateNodeIdOnlineRequest(this.document, this.nodeId, {this.loadEncoding, this.password, this.encryptedPassword}); | ||
|
||
@override | ||
Future<ApiRequestData> createRequestData(final ApiClient _apiClient) async { | ||
var _path = '/words/online/get/translate/{nodeId}'; | ||
var _queryParams = <String, String>{}; | ||
var _headers = <String, String>{}; | ||
var _bodyParts = <ApiRequestPart>[]; | ||
var _fileContentParts = <FileReference>[]; | ||
if (nodeId == null) { | ||
throw ApiException(400, 'Parameter nodeId is required.'); | ||
} | ||
_path = _path.replaceAll('{nodeId}', _apiClient.serializeToString(nodeId) ?? ""); | ||
if (loadEncoding != null) { | ||
_queryParams['loadEncoding'] = _apiClient.serializeToString(loadEncoding) ?? ""; | ||
} | ||
|
||
if (password != null) { | ||
_queryParams['encryptedPassword'] = await _apiClient.encryptPassword(password!); | ||
} | ||
|
||
if (encryptedPassword != null) { | ||
_queryParams['encryptedPassword'] = _apiClient.serializeToString(encryptedPassword) ?? ""; | ||
} | ||
|
||
if (document != null) { | ||
|
||
var _formBody = _apiClient.serializeBody(document, 'Document'); | ||
if (_formBody != null) { | ||
_bodyParts.add(_formBody); | ||
} | ||
} | ||
else { | ||
throw ApiException(400, 'Parameter document is required.'); | ||
} | ||
|
||
for (final _fileContentPart in _fileContentParts) { | ||
_fileContentPart.encryptPassword(_apiClient); | ||
if (_fileContentPart.source == 'Request') { | ||
_bodyParts.add(ApiRequestPart(_fileContentPart.content!, 'application/octet-stream', name: _fileContentPart.reference)); | ||
} | ||
} | ||
var _url = _apiClient.configuration.getApiRootUrl() + _apiClient.applyQueryParams(_path, _queryParams).replaceAll('//', '/'); | ||
var _body = _apiClient.serializeBodyParts(_bodyParts, _headers); | ||
return ApiRequestData('PUT', _url, _headers, _body); | ||
} | ||
|
||
@override | ||
dynamic deserializeResponse(final ApiClient _apiClient, final Map<String, String> _headers, final ByteData? _body) { | ||
if (_body == null) { | ||
return ApiException(400, "Nullable response body is not allowed for this operation type."); | ||
} | ||
|
||
var _result = TranslateNodeIdResponse(); | ||
var _jsonData = utf8.decode(_body.buffer.asUint8List(_body.offsetInBytes, _body.lengthInBytes)); | ||
var _json = jsonDecode(_jsonData); | ||
_result.deserialize(_json as Map<String, dynamic>); | ||
return _result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/* | ||
* -------------------------------------------------------------------------------- | ||
* <copyright company="Aspose" file="translate_node_id_request.dart"> | ||
* Copyright (c) 2024 Aspose.Words for Cloud | ||
* </copyright> | ||
* <summary> | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* </summary> | ||
* -------------------------------------------------------------------------------- | ||
*/ | ||
|
||
library aspose_words_cloud; | ||
|
||
import 'dart:convert'; | ||
import 'dart:typed_data'; | ||
import '../../aspose_words_cloud.dart'; | ||
import '../api_client.dart'; | ||
import '../api_request_data.dart'; | ||
import '../api_request_part.dart'; | ||
|
||
/// Request model for TranslateNodeId operation. | ||
class TranslateNodeIdRequest implements RequestBase { | ||
/// The filename of the input document. | ||
final String? name; | ||
|
||
/// The node identifier. Identifier examples: id0.0.0. | ||
final String? nodeId; | ||
|
||
/// Original document folder. | ||
final String? folder; | ||
|
||
/// Original document storage. | ||
final String? storage; | ||
|
||
/// Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML. | ||
final String? loadEncoding; | ||
|
||
/// 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. | ||
final String? password; | ||
|
||
/// Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details. | ||
final String? encryptedPassword; | ||
|
||
TranslateNodeIdRequest(this.name, this.nodeId, {this.folder, this.storage, this.loadEncoding, this.password, this.encryptedPassword}); | ||
|
||
@override | ||
Future<ApiRequestData> createRequestData(final ApiClient _apiClient) async { | ||
var _path = '/words/{name}/translate/{nodeId}'; | ||
var _queryParams = <String, String>{}; | ||
var _headers = <String, String>{}; | ||
var _bodyParts = <ApiRequestPart>[]; | ||
var _fileContentParts = <FileReference>[]; | ||
if (name == null) { | ||
throw ApiException(400, 'Parameter name is required.'); | ||
} | ||
_path = _path.replaceAll('{name}', _apiClient.serializeToString(name) ?? ""); | ||
|
||
if (nodeId == null) { | ||
throw ApiException(400, 'Parameter nodeId is required.'); | ||
} | ||
_path = _path.replaceAll('{nodeId}', _apiClient.serializeToString(nodeId) ?? ""); | ||
if (folder != null) { | ||
_queryParams['folder'] = _apiClient.serializeToString(folder) ?? ""; | ||
} | ||
|
||
if (storage != null) { | ||
_queryParams['storage'] = _apiClient.serializeToString(storage) ?? ""; | ||
} | ||
|
||
if (loadEncoding != null) { | ||
_queryParams['loadEncoding'] = _apiClient.serializeToString(loadEncoding) ?? ""; | ||
} | ||
|
||
if (password != null) { | ||
_queryParams['encryptedPassword'] = await _apiClient.encryptPassword(password!); | ||
} | ||
|
||
if (encryptedPassword != null) { | ||
_queryParams['encryptedPassword'] = _apiClient.serializeToString(encryptedPassword) ?? ""; | ||
} | ||
|
||
for (final _fileContentPart in _fileContentParts) { | ||
_fileContentPart.encryptPassword(_apiClient); | ||
if (_fileContentPart.source == 'Request') { | ||
_bodyParts.add(ApiRequestPart(_fileContentPart.content!, 'application/octet-stream', name: _fileContentPart.reference)); | ||
} | ||
} | ||
var _url = _apiClient.configuration.getApiRootUrl() + _apiClient.applyQueryParams(_path, _queryParams).replaceAll('//', '/'); | ||
var _body = _apiClient.serializeBodyParts(_bodyParts, _headers); | ||
return ApiRequestData('GET', _url, _headers, _body); | ||
} | ||
|
||
@override | ||
dynamic deserializeResponse(final ApiClient _apiClient, final Map<String, String> _headers, final ByteData? _body) { | ||
if (_body == null) { | ||
return ApiException(400, "Nullable response body is not allowed for this operation type."); | ||
} | ||
|
||
var _result = TranslateNodeIdResponse(); | ||
var _jsonData = utf8.decode(_body.buffer.asUint8List(_body.offsetInBytes, _body.lengthInBytes)); | ||
var _json = jsonDecode(_jsonData); | ||
_result.deserialize(_json as Map<String, dynamic>); | ||
return _result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.