createRequestData method
Future<ApiRequestData>
createRequestData(
- ApiClient _apiClient
)
override
Implementation
@override
Future<ApiRequestData> createRequestData(final ApiClient _apiClient) async {
var _path = '/words/online/get/{tablePath}/rows/{index}';
var _queryParams = <String, String>{};
var _headers = <String, String>{};
var _bodyParts = <ApiRequestPart>[];
var _fileContentParts = <FileReference>[];
if (tablePath == null) {
throw ApiException(400, 'Parameter tablePath is required.');
}
_path = _path.replaceAll(
'{tablePath}', _apiClient.serializeToString(tablePath) ?? "");
if (index == null) {
throw ApiException(400, 'Parameter index is required.');
}
_path =
_path.replaceAll('{index}', _apiClient.serializeToString(index) ?? "");
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);
}