@@ -39,7 +39,7 @@ public class WordsAPI {
3939 }
4040
4141 // Initializes a new instance of the WordsAPI class based on AppSid and AppKey.
42- public init(appSid: String, appKey: String) {
42+ public init(appSid: String, appKey: String) {
4343 self.configuration = Configuration(appSid: appSid, appKey: appKey);
4444 self.apiInvoker = ApiInvoker(configuration: configuration);
4545 }
@@ -426,7 +426,7 @@ public class WordsAPI {
426426 }
427427
428428 // Async representation of convertDocument method
429- // Converts document from the request's content to the specified format .
429+ // Converts document from the request's content to the specified format.
430430 public func convertDocument(request : ConvertDocumentRequest, callback : @escaping (_ response : Data?, _ error : Error?) -> ()) {
431431 do {
432432 let rawPath = "/words/convert";
@@ -472,7 +472,7 @@ public class WordsAPI {
472472 }
473473
474474 // Sync representation of convertDocument method
475- // Converts document from the request's content to the specified format .
475+ // Converts document from the request's content to the specified format.
476476 public func convertDocument(request : ConvertDocumentRequest) throws -> Data {
477477 let semaphore = DispatchSemaphore(value: 0);
478478 var responseObject : Data? = nil;
@@ -7041,7 +7041,9 @@ public class WordsAPI {
70417041 var rawPath = "/words/{name}/range/{rangeStartIdentifier}/{rangeEndIdentifier}";
70427042 rawPath = rawPath.replacingOccurrences(of: "{name}", with: try ObjectSerializer.serializeToString(value: request.getName()));
70437043 rawPath = rawPath.replacingOccurrences(of: "{rangeStartIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeStartIdentifier()));
7044- rawPath = rawPath.replacingOccurrences(of: "{rangeEndIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeEndIdentifier()));
7044+ if (request.getRangeEndIdentifier() != nil) {
7045+ rawPath = rawPath.replacingOccurrences(of: "{rangeEndIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeEndIdentifier()!));
7046+ }
70457047 let urlPath = (try self.configuration.getApiRootUrl()).appendingPathComponent(rawPath);
70467048
70477049 var urlBuilder = URLComponents(url: urlPath, resolvingAgainstBaseURL: false)!;
@@ -10283,7 +10285,9 @@ public class WordsAPI {
1028310285 var rawPath = "/words/{name}/range/{rangeStartIdentifier}/{rangeEndIdentifier}";
1028410286 rawPath = rawPath.replacingOccurrences(of: "{name}", with: try ObjectSerializer.serializeToString(value: request.getName()));
1028510287 rawPath = rawPath.replacingOccurrences(of: "{rangeStartIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeStartIdentifier()));
10286- rawPath = rawPath.replacingOccurrences(of: "{rangeEndIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeEndIdentifier()));
10288+ if (request.getRangeEndIdentifier() != nil) {
10289+ rawPath = rawPath.replacingOccurrences(of: "{rangeEndIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeEndIdentifier()!));
10290+ }
1028710291 let urlPath = (try self.configuration.getApiRootUrl()).appendingPathComponent(rawPath);
1028810292
1028910293 var urlBuilder = URLComponents(url: urlPath, resolvingAgainstBaseURL: false)!;
@@ -11070,7 +11074,9 @@ public class WordsAPI {
1107011074 var rawPath = "/words/{name}/range/{rangeStartIdentifier}/{rangeEndIdentifier}";
1107111075 rawPath = rawPath.replacingOccurrences(of: "{name}", with: try ObjectSerializer.serializeToString(value: request.getName()));
1107211076 rawPath = rawPath.replacingOccurrences(of: "{rangeStartIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeStartIdentifier()));
11073- rawPath = rawPath.replacingOccurrences(of: "{rangeEndIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeEndIdentifier()));
11077+ if (request.getRangeEndIdentifier() != nil) {
11078+ rawPath = rawPath.replacingOccurrences(of: "{rangeEndIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeEndIdentifier()!));
11079+ }
1107411080 let urlPath = (try self.configuration.getApiRootUrl()).appendingPathComponent(rawPath);
1107511081
1107611082 var urlBuilder = URLComponents(url: urlPath, resolvingAgainstBaseURL: false)!;
@@ -11272,7 +11278,9 @@ public class WordsAPI {
1127211278 var rawPath = "/words/{name}/range/{rangeStartIdentifier}/{rangeEndIdentifier}/SaveAs";
1127311279 rawPath = rawPath.replacingOccurrences(of: "{name}", with: try ObjectSerializer.serializeToString(value: request.getName()));
1127411280 rawPath = rawPath.replacingOccurrences(of: "{rangeStartIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeStartIdentifier()));
11275- rawPath = rawPath.replacingOccurrences(of: "{rangeEndIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeEndIdentifier()));
11281+ if (request.getRangeEndIdentifier() != nil) {
11282+ rawPath = rawPath.replacingOccurrences(of: "{rangeEndIdentifier}", with: try ObjectSerializer.serializeToString(value: request.getRangeEndIdentifier()!));
11283+ }
1127611284 let urlPath = (try self.configuration.getApiRootUrl()).appendingPathComponent(rawPath);
1127711285
1127811286 var urlBuilder = URLComponents(url: urlPath, resolvingAgainstBaseURL: false)!;
@@ -11554,6 +11562,7 @@ public class WordsAPI {
1155411562
1155511563 var urlBuilder = URLComponents(url: urlPath, resolvingAgainstBaseURL: false)!;
1155611564 var queryItems : [URLQueryItem] = [];
11565+ queryItems.append(URLQueryItem(name: "format", value: try ObjectSerializer.serializeToString(value: request.getFormat())));
1155711566 if (request.getFolder() != nil) {
1155811567 queryItems.append(URLQueryItem(name: "folder", value: try ObjectSerializer.serializeToString(value: request.getFolder()!)));
1155911568 }
@@ -11569,9 +11578,6 @@ public class WordsAPI {
1156911578 if (request.getDestFileName() != nil) {
1157011579 queryItems.append(URLQueryItem(name: "destFileName", value: try ObjectSerializer.serializeToString(value: request.getDestFileName()!)));
1157111580 }
11572- if (request.getFormat() != nil) {
11573- queryItems.append(URLQueryItem(name: "format", value: try ObjectSerializer.serializeToString(value: request.getFormat()!)));
11574- }
1157511581 if (request.getFrom() != nil) {
1157611582 queryItems.append(URLQueryItem(name: "from", value: try ObjectSerializer.serializeToString(value: request.getFrom()!)));
1157711583 }
0 commit comments