@@ -1858,6 +1858,11 @@ public protocol ClientBuilderProtocol : AnyObject {
1858
1858
1859
1859
func proxy(url: String) -> ClientBuilder
1860
1860
1861
+ /**
1862
+ * Add a default request config to this client.
1863
+ */
1864
+ func requestConfig(config: RequestConfig) -> ClientBuilder
1865
+
1861
1866
func requiresSlidingSync() -> ClientBuilder
1862
1867
1863
1868
func serverName(serverName: String) -> ClientBuilder
@@ -2079,6 +2084,17 @@ open func proxy(url: String) -> ClientBuilder {
2079
2084
FfiConverterString.lower(url),$0
2080
2085
)
2081
2086
})
2087
+ }
2088
+
2089
+ /**
2090
+ * Add a default request config to this client.
2091
+ */
2092
+ open func requestConfig(config: RequestConfig) -> ClientBuilder {
2093
+ return try! FfiConverterTypeClientBuilder.lift(try! rustCall() {
2094
+ uniffi_matrix_sdk_ffi_fn_method_clientbuilder_request_config(self.uniffiClonePointer(),
2095
+ FfiConverterTypeRequestConfig.lower(config),$0
2096
+ )
2097
+ })
2082
2098
}
2083
2099
2084
2100
open func requiresSlidingSync() -> ClientBuilder {
@@ -12751,6 +12767,106 @@ public func FfiConverterTypeReceipt_lower(_ value: Receipt) -> RustBuffer {
12751
12767
}
12752
12768
12753
12769
12770
+ /**
12771
+ * The config to use for HTTP requests by default in this client.
12772
+ */
12773
+ public struct RequestConfig {
12774
+ /**
12775
+ * Max number of retries.
12776
+ */
12777
+ public var retryLimit: UInt64?
12778
+ /**
12779
+ * Timeout for a request in milliseconds.
12780
+ */
12781
+ public var timeout: UInt64?
12782
+ /**
12783
+ * Max number of concurrent requests. No value means no limits.
12784
+ */
12785
+ public var maxConcurrentRequests: UInt64?
12786
+ /**
12787
+ * Base delay between retries.
12788
+ */
12789
+ public var retryTimeout: UInt64?
12790
+
12791
+ // Default memberwise initializers are never public by default, so we
12792
+ // declare one manually.
12793
+ public init(
12794
+ /**
12795
+ * Max number of retries.
12796
+ */retryLimit: UInt64?,
12797
+ /**
12798
+ * Timeout for a request in milliseconds.
12799
+ */timeout: UInt64?,
12800
+ /**
12801
+ * Max number of concurrent requests. No value means no limits.
12802
+ */maxConcurrentRequests: UInt64?,
12803
+ /**
12804
+ * Base delay between retries.
12805
+ */retryTimeout: UInt64?) {
12806
+ self.retryLimit = retryLimit
12807
+ self.timeout = timeout
12808
+ self.maxConcurrentRequests = maxConcurrentRequests
12809
+ self.retryTimeout = retryTimeout
12810
+ }
12811
+ }
12812
+
12813
+
12814
+
12815
+ extension RequestConfig: Equatable, Hashable {
12816
+ public static func ==(lhs: RequestConfig, rhs: RequestConfig) -> Bool {
12817
+ if lhs.retryLimit != rhs.retryLimit {
12818
+ return false
12819
+ }
12820
+ if lhs.timeout != rhs.timeout {
12821
+ return false
12822
+ }
12823
+ if lhs.maxConcurrentRequests != rhs.maxConcurrentRequests {
12824
+ return false
12825
+ }
12826
+ if lhs.retryTimeout != rhs.retryTimeout {
12827
+ return false
12828
+ }
12829
+ return true
12830
+ }
12831
+
12832
+ public func hash(into hasher: inout Hasher) {
12833
+ hasher.combine(retryLimit)
12834
+ hasher.combine(timeout)
12835
+ hasher.combine(maxConcurrentRequests)
12836
+ hasher.combine(retryTimeout)
12837
+ }
12838
+ }
12839
+
12840
+
12841
+ public struct FfiConverterTypeRequestConfig: FfiConverterRustBuffer {
12842
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RequestConfig {
12843
+ return
12844
+ try RequestConfig(
12845
+ retryLimit: FfiConverterOptionUInt64.read(from: &buf),
12846
+ timeout: FfiConverterOptionUInt64.read(from: &buf),
12847
+ maxConcurrentRequests: FfiConverterOptionUInt64.read(from: &buf),
12848
+ retryTimeout: FfiConverterOptionUInt64.read(from: &buf)
12849
+ )
12850
+ }
12851
+
12852
+ public static func write(_ value: RequestConfig, into buf: inout [UInt8]) {
12853
+ FfiConverterOptionUInt64.write(value.retryLimit, into: &buf)
12854
+ FfiConverterOptionUInt64.write(value.timeout, into: &buf)
12855
+ FfiConverterOptionUInt64.write(value.maxConcurrentRequests, into: &buf)
12856
+ FfiConverterOptionUInt64.write(value.retryTimeout, into: &buf)
12857
+ }
12858
+ }
12859
+
12860
+
12861
+ public func FfiConverterTypeRequestConfig_lift(_ buf: RustBuffer) throws -> RequestConfig {
12862
+ return try FfiConverterTypeRequestConfig.lift(buf)
12863
+ }
12864
+
12865
+ public func FfiConverterTypeRequestConfig_lower(_ value: RequestConfig) -> RustBuffer {
12866
+ return FfiConverterTypeRequestConfig.lower(value)
12867
+ }
12868
+
12869
+
12754
12870
public struct RequiredState {
12755
12871
public var key: String
12756
12872
public var value: String
@@ -26544,6 +26660,9 @@ private var initializationResult: InitializationResult = {
26544
26660
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_proxy() != 5659) {
26545
26661
return InitializationResult.apiChecksumMismatch
26546
26662
}
26663
+ if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_request_config() != 58783) {
26664
+ return InitializationResult.apiChecksumMismatch
26665
+ }
26547
26666
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_requires_sliding_sync() != 18165) {
26548
26667
return InitializationResult.apiChecksumMismatch
26549
26668
}
0 commit comments