Skip to content

Commit 9fc7a62

Browse files
Merge remote-tracking branch 'origin/master' into release
2 parents 394169d + bb5c4d8 commit 9fc7a62

File tree

8 files changed

+589
-15
lines changed

8 files changed

+589
-15
lines changed

AsposeWordsCloud.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'AsposeWordsCloud'
3-
s.version = '23.4'
3+
s.version = '23.5'
44
s.summary = 'Aspose Words for Cloud.'
55
s.homepage = 'https://github.com/aspose-words-cloud/aspose-words-cloud-swift.git'
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ This repository contains Aspose.Words Cloud SDK for Swift source code. This SDK
1313
* Watermarks and protection
1414
* Full read & write access to Document Object Model, including sections, paragraphs, text, images, tables, headers/footers and many others
1515

16+
## Enhancements in Version 23.5
17+
18+
- Added InsertSection method.
19+
20+
1621
## Enhancements in Version 23.4
1722

1823
- Added new type of RangeEndIdentifier for RangeApi: document:end
@@ -273,7 +278,7 @@ Add link to this repository as dependency to your Package.swift:
273278

274279
dependencies: [
275280
// Dependencies declare other packages that this package depends on.
276-
.package(url: "https://github.com/aspose-words-cloud/aspose-words-cloud-swift", from: "23.4"),
281+
.package(url: "https://github.com/aspose-words-cloud/aspose-words-cloud-swift", from: "23.5"),
277282
],
278283
targets: [
279284
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
@@ -291,7 +296,7 @@ targets: [
291296
Add link to git repository as dependency to your Podfile:
292297

293298
```ruby
294-
pod 'AsposeWordsCloud', :git => 'https://github.com/aspose-words-cloud/aspose-words-cloud-swift.git', :tag => '23.4'
299+
pod 'AsposeWordsCloud', :git => 'https://github.com/aspose-words-cloud/aspose-words-cloud-swift.git', :tag => '23.5'
295300
```
296301

297302
## Getting Started

Sources/AsposeWordsCloud/Api/Configuration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,6 @@ public class Configuration : Codable {
188188

189189
// Returns SDK version for using in statistics headers
190190
public func getSdkVersion() -> String {
191-
return "23.4";
191+
return "23.5";
192192
}
193193
}

Sources/AsposeWordsCloud/Api/WordsAPI.swift

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12220,6 +12220,101 @@ public class WordsAPI : Encryptor {
1222012220
return responseObject!;
1222112221
}
1222212222

12223+
// Async representation of insertSection method
12224+
// Inserts a section to the document.
12225+
public func insertSection(request : InsertSectionRequest, callback : @escaping (_ error : Error?) -> ()) {
12226+
do {
12227+
if (self.apiInvoker == nil) {
12228+
#if os(Linux)
12229+
self.apiInvoker = ApiInvoker(configuration: configuration);
12230+
#else
12231+
self.apiInvoker = ApiInvoker(configuration: configuration, encryptor: self);
12232+
#endif
12233+
}
12234+
12235+
apiInvoker!.invoke(
12236+
apiRequestData: try request.createApiRequestData(apiInvoker: self.apiInvoker!, configuration: self.configuration),
12237+
callback: { response, headers, error in
12238+
callback(error);
12239+
}
12240+
);
12241+
}
12242+
catch let error {
12243+
callback(error);
12244+
}
12245+
}
12246+
12247+
// Sync representation of insertSection method
12248+
// Inserts a section to the document.
12249+
public func insertSection(request : InsertSectionRequest) throws {
12250+
let semaphore = DispatchSemaphore(value: 0);
12251+
var responseError : Error? = nil;
12252+
self.insertSection(request : request, callback: { error in
12253+
responseError = error;
12254+
semaphore.signal();
12255+
});
12256+
12257+
_ = semaphore.wait();
12258+
12259+
if (responseError != nil) {
12260+
throw responseError!;
12261+
}
12262+
}
12263+
12264+
// Async representation of insertSectionOnline method
12265+
// Inserts a section to the document.
12266+
public func insertSectionOnline(request : InsertSectionOnlineRequest, callback : @escaping (_ response : [String: Data]?, _ error : Error?) -> ()) {
12267+
do {
12268+
if (self.apiInvoker == nil) {
12269+
#if os(Linux)
12270+
self.apiInvoker = ApiInvoker(configuration: configuration);
12271+
#else
12272+
self.apiInvoker = ApiInvoker(configuration: configuration, encryptor: self);
12273+
#endif
12274+
}
12275+
12276+
apiInvoker!.invoke(
12277+
apiRequestData: try request.createApiRequestData(apiInvoker: self.apiInvoker!, configuration: self.configuration),
12278+
callback: { response, headers, error in
12279+
if (error != nil) {
12280+
callback(nil, error);
12281+
}
12282+
else {
12283+
do {
12284+
callback(try request.deserializeResponse(data: response!, headers: headers) as? [String: Data], nil);
12285+
}
12286+
catch let deserializeError {
12287+
callback(nil, deserializeError);
12288+
}
12289+
}
12290+
}
12291+
);
12292+
}
12293+
catch let error {
12294+
callback(nil, error);
12295+
}
12296+
}
12297+
12298+
// Sync representation of insertSectionOnline method
12299+
// Inserts a section to the document.
12300+
public func insertSectionOnline(request : InsertSectionOnlineRequest) throws -> [String: Data] {
12301+
let semaphore = DispatchSemaphore(value: 0);
12302+
var responseObject : [String: Data]? = nil;
12303+
var responseError : Error? = nil;
12304+
self.insertSectionOnline(request : request, callback: { response, error in
12305+
responseObject = response;
12306+
responseError = error;
12307+
semaphore.signal();
12308+
});
12309+
12310+
_ = semaphore.wait();
12311+
12312+
if (responseError != nil) {
12313+
throw responseError!;
12314+
}
12315+
return responseObject!;
12316+
}
12317+
1222312318
// Async representation of insertStructuredDocumentTag method
1222412319
// Inserts a new StructuredDocumentTag (SDT) to the document node.
1222512320
public func insertStructuredDocumentTag(request : InsertStructuredDocumentTagRequest, callback : @escaping (_ response : StructuredDocumentTagResponse?, _ error : Error?) -> ()) {

Sources/AsposeWordsCloud/Model/Requests/CreateDocumentRequest.swift

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import Foundation
3030
// Request model for createDocument operation.
3131
@available(macOS 10.12, iOS 10.3, watchOS 3.3, tvOS 12.0, *)
3232
public class CreateDocumentRequest : WordsApiRequest {
33-
private let fileName : String?;
33+
private let fileName : String;
3434
private let folder : String?;
3535
private let storage : String?;
3636

@@ -42,14 +42,14 @@ public class CreateDocumentRequest : WordsApiRequest {
4242
}
4343

4444
// Initializes a new instance of the CreateDocumentRequest class.
45-
public init(fileName : String? = nil, folder : String? = nil, storage : String? = nil) {
45+
public init(fileName : String, folder : String? = nil, storage : String? = nil) {
4646
self.fileName = fileName;
4747
self.folder = folder;
4848
self.storage = storage;
4949
}
5050

5151
// The filename of the document.
52-
public func getFileName() -> String? {
52+
public func getFileName() -> String {
5353
return self.fileName;
5454
}
5555

@@ -71,16 +71,11 @@ public class CreateDocumentRequest : WordsApiRequest {
7171
let urlPath = (try configuration.getApiRootUrl()).appendingPathComponent(rawPath);
7272
var urlBuilder = URLComponents(url: urlPath, resolvingAgainstBaseURL: false)!;
7373
var queryItems : [URLQueryItem] = [];
74-
if (self.getFileName() != nil) {
75-
7674
#if os(Linux)
77-
queryItems.append(URLQueryItem(name: "fileName", value: try ObjectSerializer.serializeToString(value: self.getFileName()!)));
78-
75+
queryItems.append(URLQueryItem(name: "fileName", value: try ObjectSerializer.serializeToString(value: self.getFileName())));
7976
#else
80-
queryItems.append(URLQueryItem(name: "fileName", value: try ObjectSerializer.serializeToString(value: self.getFileName()!)));
81-
82-
#endif
83-
}
77+
queryItems.append(URLQueryItem(name: "fileName", value: try ObjectSerializer.serializeToString(value: self.getFileName())));
78+
#endif
8479

8580

8681
if (self.getFolder() != nil) {

0 commit comments

Comments
 (0)