@@ -3307,6 +3307,101 @@ public class WordsAPI : Encryptor {
33073307 return responseObject!;
33083308 }
33093309
3310+ // Async representation of deleteOfficeMathObjects method
3311+ // Removes all office math objects from the document.
3312+ public func deleteOfficeMathObjects(request : DeleteOfficeMathObjectsRequest, callback : @escaping (_ error : Error?) -> ()) {
3313+ do {
3314+ if (self.apiInvoker == nil) {
3315+ #if os(Linux)
3316+ self.apiInvoker = ApiInvoker(configuration: configuration);
3317+ #else
3318+ self.apiInvoker = ApiInvoker(configuration: configuration, encryptor: self);
3319+ #endif
3320+ }
3321+
3322+ apiInvoker!.invoke(
3323+ apiRequestData: try request.createApiRequestData(apiInvoker: self.apiInvoker!, configuration: self.configuration),
3324+ callback: { response, headers, error in
3325+ callback(error);
3326+ }
3327+ );
3328+ }
3329+ catch let error {
3330+ callback(error);
3331+ }
3332+ }
3333+
3334+ // Sync representation of deleteOfficeMathObjects method
3335+ // Removes all office math objects from the document.
3336+ public func deleteOfficeMathObjects(request : DeleteOfficeMathObjectsRequest) throws {
3337+ let semaphore = DispatchSemaphore(value: 0);
3338+ var responseError : Error? = nil;
3339+ self.deleteOfficeMathObjects(request : request, callback: { error in
3340+ responseError = error;
3341+ semaphore.signal();
3342+ });
3343+
3344+ _ = semaphore.wait();
3345+
3346+ if (responseError != nil) {
3347+ throw responseError!;
3348+ }
3349+ }
3350+
3351+ // Async representation of deleteOfficeMathObjectsOnline method
3352+ // Removes all office math objects from the document.
3353+ public func deleteOfficeMathObjectsOnline(request : DeleteOfficeMathObjectsOnlineRequest, callback : @escaping (_ response : [String: Data]?, _ error : Error?) -> ()) {
3354+ do {
3355+ if (self.apiInvoker == nil) {
3356+ #if os(Linux)
3357+ self.apiInvoker = ApiInvoker(configuration: configuration);
3358+ #else
3359+ self.apiInvoker = ApiInvoker(configuration: configuration, encryptor: self);
3360+ #endif
3361+ }
3362+
3363+ apiInvoker!.invoke(
3364+ apiRequestData: try request.createApiRequestData(apiInvoker: self.apiInvoker!, configuration: self.configuration),
3365+ callback: { response, headers, error in
3366+ if (error != nil) {
3367+ callback(nil, error);
3368+ }
3369+ else {
3370+ do {
3371+ callback(try request.deserializeResponse(data: response!, headers: headers) as? [String: Data], nil);
3372+ }
3373+ catch let deserializeError {
3374+ callback(nil, deserializeError);
3375+ }
3376+ }
3377+ }
3378+ );
3379+ }
3380+ catch let error {
3381+ callback(nil, error);
3382+ }
3383+ }
3384+
3385+ // Sync representation of deleteOfficeMathObjectsOnline method
3386+ // Removes all office math objects from the document.
3387+ public func deleteOfficeMathObjectsOnline(request : DeleteOfficeMathObjectsOnlineRequest) throws -> [String: Data] {
3388+ let semaphore = DispatchSemaphore(value: 0);
3389+ var responseObject : [String: Data]? = nil;
3390+ var responseError : Error? = nil;
3391+ self.deleteOfficeMathObjectsOnline(request : request, callback: { response, error in
3392+ responseObject = response;
3393+ responseError = error;
3394+ semaphore.signal();
3395+ });
3396+
3397+ _ = semaphore.wait();
3398+
3399+ if (responseError != nil) {
3400+ throw responseError!;
3401+ }
3402+ return responseObject!;
3403+ }
3404+
33103405 // Async representation of deleteParagraph method
33113406 // Removes a paragraph from the document node.
33123407 public func deleteParagraph(request : DeleteParagraphRequest, callback : @escaping (_ error : Error?) -> ()) {
@@ -12873,8 +12968,63 @@ public class WordsAPI : Encryptor {
1287312968 return responseObject!;
1287412969 }
1287512970
12971+ // Async representation of insertWatermark method
12972+ // Insert a watermark to the document.
12973+ public func insertWatermark(request : InsertWatermarkRequest, callback : @escaping (_ response : DocumentResponse?, _ error : Error?) -> ()) {
12974+ do {
12975+ if (self.apiInvoker == nil) {
12976+ #if os(Linux)
12977+ self.apiInvoker = ApiInvoker(configuration: configuration);
12978+ #else
12979+ self.apiInvoker = ApiInvoker(configuration: configuration, encryptor: self);
12980+ #endif
12981+ }
12982+
12983+ apiInvoker!.invoke(
12984+ apiRequestData: try request.createApiRequestData(apiInvoker: self.apiInvoker!, configuration: self.configuration),
12985+ callback: { response, headers, error in
12986+ if (error != nil) {
12987+ callback(nil, error);
12988+ }
12989+ else {
12990+ do {
12991+ callback(try request.deserializeResponse(data: response!, headers: headers) as? DocumentResponse, nil);
12992+ }
12993+ catch let deserializeError {
12994+ callback(nil, deserializeError);
12995+ }
12996+ }
12997+ }
12998+ );
12999+ }
13000+ catch let error {
13001+ callback(nil, error);
13002+ }
13003+ }
13004+
13005+ // Sync representation of insertWatermark method
13006+ // Insert a watermark to the document.
13007+ public func insertWatermark(request : InsertWatermarkRequest) throws -> DocumentResponse {
13008+ let semaphore = DispatchSemaphore(value: 0);
13009+ var responseObject : DocumentResponse? = nil;
13010+ var responseError : Error? = nil;
13011+ self.insertWatermark(request : request, callback: { response, error in
13012+ responseObject = response;
13013+ responseError = error;
13014+ semaphore.signal();
13015+ });
13016+
13017+ _ = semaphore.wait();
13018+
13019+ if (responseError != nil) {
13020+ throw responseError!;
13021+ }
13022+ return responseObject!;
13023+ }
13024+
1287613025 // Async representation of insertWatermarkImage method
1287713026 // Inserts a new watermark image to the document.
13027+ @available(*, deprecated, message: "This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead.")
1287813028 public func insertWatermarkImage(request : InsertWatermarkImageRequest, callback : @escaping (_ response : DocumentResponse?, _ error : Error?) -> ()) {
1287913029 do {
1288013030 if (self.apiInvoker == nil) {
@@ -12929,6 +13079,7 @@ public class WordsAPI : Encryptor {
1292913079
1293013080 // Async representation of insertWatermarkImageOnline method
1293113081 // Inserts a new watermark image to the document.
13082+ @available(*, deprecated, message: "This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead.")
1293213083 public func insertWatermarkImageOnline(request : InsertWatermarkImageOnlineRequest, callback : @escaping (_ response : InsertWatermarkImageOnlineResponse?, _ error : Error?) -> ()) {
1293313084 do {
1293413085 if (self.apiInvoker == nil) {
@@ -12981,8 +13132,63 @@ public class WordsAPI : Encryptor {
1298113132 return responseObject!;
1298213133 }
1298313134
13135+ // Async representation of insertWatermarkOnline method
13136+ // Insert a watermark to the document.
13137+ public func insertWatermarkOnline(request : InsertWatermarkOnlineRequest, callback : @escaping (_ response : InsertWatermarkOnlineResponse?, _ error : Error?) -> ()) {
13138+ do {
13139+ if (self.apiInvoker == nil) {
13140+ #if os(Linux)
13141+ self.apiInvoker = ApiInvoker(configuration: configuration);
13142+ #else
13143+ self.apiInvoker = ApiInvoker(configuration: configuration, encryptor: self);
13144+ #endif
13145+ }
13146+
13147+ apiInvoker!.invoke(
13148+ apiRequestData: try request.createApiRequestData(apiInvoker: self.apiInvoker!, configuration: self.configuration),
13149+ callback: { response, headers, error in
13150+ if (error != nil) {
13151+ callback(nil, error);
13152+ }
13153+ else {
13154+ do {
13155+ callback(try request.deserializeResponse(data: response!, headers: headers) as? InsertWatermarkOnlineResponse, nil);
13156+ }
13157+ catch let deserializeError {
13158+ callback(nil, deserializeError);
13159+ }
13160+ }
13161+ }
13162+ );
13163+ }
13164+ catch let error {
13165+ callback(nil, error);
13166+ }
13167+ }
13168+
13169+ // Sync representation of insertWatermarkOnline method
13170+ // Insert a watermark to the document.
13171+ public func insertWatermarkOnline(request : InsertWatermarkOnlineRequest) throws -> InsertWatermarkOnlineResponse {
13172+ let semaphore = DispatchSemaphore(value: 0);
13173+ var responseObject : InsertWatermarkOnlineResponse? = nil;
13174+ var responseError : Error? = nil;
13175+ self.insertWatermarkOnline(request : request, callback: { response, error in
13176+ responseObject = response;
13177+ responseError = error;
13178+ semaphore.signal();
13179+ });
13180+
13181+ _ = semaphore.wait();
13182+
13183+ if (responseError != nil) {
13184+ throw responseError!;
13185+ }
13186+ return responseObject!;
13187+ }
13188+
1298413189 // Async representation of insertWatermarkText method
1298513190 // Inserts a new watermark text to the document.
13191+ @available(*, deprecated, message: "This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead.")
1298613192 public func insertWatermarkText(request : InsertWatermarkTextRequest, callback : @escaping (_ response : DocumentResponse?, _ error : Error?) -> ()) {
1298713193 do {
1298813194 if (self.apiInvoker == nil) {
@@ -13037,6 +13243,7 @@ public class WordsAPI : Encryptor {
1303713243
1303813244 // Async representation of insertWatermarkTextOnline method
1303913245 // Inserts a new watermark text to the document.
13246+ @available(*, deprecated, message: "This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead.")
1304013247 public func insertWatermarkTextOnline(request : InsertWatermarkTextOnlineRequest, callback : @escaping (_ response : InsertWatermarkTextOnlineResponse?, _ error : Error?) -> ()) {
1304113248 do {
1304213249 if (self.apiInvoker == nil) {
@@ -13362,7 +13569,7 @@ public class WordsAPI : Encryptor {
1336213569 }
1336313570
1336413571 // Async representation of protectDocument method
13365- // Adds protection to the document .
13572+ // Changes the document protection. The previous protection will be overwritten if it exist .
1336613573 public func protectDocument(request : ProtectDocumentRequest, callback : @escaping (_ response : ProtectionDataResponse?, _ error : Error?) -> ()) {
1336713574 do {
1336813575 if (self.apiInvoker == nil) {
@@ -13396,7 +13603,7 @@ public class WordsAPI : Encryptor {
1339613603 }
1339713604
1339813605 // Sync representation of protectDocument method
13399- // Adds protection to the document .
13606+ // Changes the document protection. The previous protection will be overwritten if it exist .
1340013607 public func protectDocument(request : ProtectDocumentRequest) throws -> ProtectionDataResponse {
1340113608 let semaphore = DispatchSemaphore(value: 0);
1340213609 var responseObject : ProtectionDataResponse? = nil;
@@ -13416,7 +13623,7 @@ public class WordsAPI : Encryptor {
1341613623 }
1341713624
1341813625 // Async representation of protectDocumentOnline method
13419- // Adds protection to the document .
13626+ // Changes the document protection. The previous protection will be overwritten if it exist .
1342013627 public func protectDocumentOnline(request : ProtectDocumentOnlineRequest, callback : @escaping (_ response : ProtectDocumentOnlineResponse?, _ error : Error?) -> ()) {
1342113628 do {
1342213629 if (self.apiInvoker == nil) {
@@ -13450,7 +13657,7 @@ public class WordsAPI : Encryptor {
1345013657 }
1345113658
1345213659 // Sync representation of protectDocumentOnline method
13453- // Adds protection to the document .
13660+ // Changes the document protection. The previous protection will be overwritten if it exist .
1345413661 public func protectDocumentOnline(request : ProtectDocumentOnlineRequest) throws -> ProtectDocumentOnlineResponse {
1345513662 let semaphore = DispatchSemaphore(value: 0);
1345613663 var responseObject : ProtectDocumentOnlineResponse? = nil;
0 commit comments