@@ -42,20 +42,25 @@ public class Configuration : Codable {
4242 // Indicating whether debug mode
4343 private var debugMode : Bool ? ;
4444
45+ // Specify request timeout
46+ private var timeout : TimeInterval ;
47+
4548 private enum CodingKeys : String , CodingKey {
4649 case baseUrl = " BaseUrl " ;
4750 case clientId = " ClientId " ;
4851 case clientSecret = " ClientSecret " ;
4952 case debugMode = " DebugMode " ;
53+ case timeout = " Timeout " ;
5054 case invalidCodingKey;
5155 }
5256
5357 // Initialize new instance of Aspose.Words for Cloud configuration object with given parameters
54- public init ( clientId: String , clientSecret: String , baseUrl: String = " https://api.aspose.cloud " , debugMode: Bool = false ) {
58+ public init ( clientId: String , clientSecret: String , baseUrl: String = " https://api.aspose.cloud " , debugMode: Bool = false , timeout : TimeInterval = 300 ) {
5559 self . clientId = clientId;
5660 self . clientSecret = clientSecret;
5761 self . baseUrl = baseUrl;
5862 self . debugMode = debugMode;
63+ self . timeout = timeout;
5964 }
6065
6166 public required init ( from decoder: Decoder ) throws {
@@ -64,6 +69,7 @@ public class Configuration : Codable {
6469 self . clientId = try container. decode ( String . self, forKey: . clientId) ;
6570 self . clientSecret = try container. decode ( String . self, forKey: . clientSecret) ;
6671 self . debugMode = try container. decodeIfPresent ( Bool . self, forKey: . debugMode) ;
72+ self . timeout = try container. decodeIfPresent ( TimeInterval . self, forKey: . timeout) ?? 300 ;
6773 }
6874
6975 public func encode( to encoder: Encoder ) throws {
@@ -74,6 +80,7 @@ public class Configuration : Codable {
7480 if ( self . debugMode != nil ) {
7581 try container. encode ( self . debugMode, forKey: . debugMode) ;
7682 }
83+ try container. encode ( self . timeout, forKey: . timeout) ;
7784 }
7885
7986 // Returns Aspose.Words for Cloud base URL
@@ -96,6 +103,11 @@ public class Configuration : Codable {
96103 return self . debugMode != nil ? self . debugMode! : false ;
97104 }
98105
106+ // Gets request timeout
107+ public func getTimeout( ) -> TimeInterval {
108+ return self . timeout;
109+ }
110+
99111 // Returns general version of cloud api
100112 public func getApiVersion( ) -> String {
101113 return " v4.0 " ;
@@ -118,6 +130,6 @@ public class Configuration : Codable {
118130
119131 // Returns SDK version for using in statistics headers
120132 public func getSdkVersion( ) -> String {
121- return " 21.11 " ;
133+ return " 21.12 " ;
122134 }
123135}
0 commit comments