@@ -10,16 +10,16 @@ import Foundation
10
10
import MullvadTypes
11
11
import WireGuardKitTypes
12
12
13
- public protocol APIQuerying {
13
+ public protocol APIQuerying : Sendable {
14
14
func getAddressList(
15
15
retryStrategy: REST . RetryStrategy ,
16
- completionHandler: @escaping ProxyCompletionHandler < [ AnyIPEndpoint ] >
16
+ completionHandler: @escaping @ Sendable ProxyCompletionHandler < [ AnyIPEndpoint ] >
17
17
) -> Cancellable
18
18
19
19
func getRelays(
20
20
etag: String ? ,
21
21
retryStrategy: REST . RetryStrategy ,
22
- completionHandler: @escaping ProxyCompletionHandler < REST . ServerRelaysCacheResponse >
22
+ completionHandler: @escaping @ Sendable ProxyCompletionHandler < REST . ServerRelaysCacheResponse >
23
23
) -> Cancellable
24
24
25
25
func createApplePayment(
@@ -30,19 +30,19 @@ public protocol APIQuerying {
30
30
func sendProblemReport(
31
31
_ body: REST . ProblemReportRequest ,
32
32
retryStrategy: REST . RetryStrategy ,
33
- completionHandler: @escaping ProxyCompletionHandler < Void >
33
+ completionHandler: @escaping @ Sendable ProxyCompletionHandler < Void >
34
34
) -> Cancellable
35
35
36
36
func submitVoucher(
37
37
voucherCode: String ,
38
38
accountNumber: String ,
39
39
retryStrategy: REST . RetryStrategy ,
40
- completionHandler: @escaping ProxyCompletionHandler < REST . SubmitVoucherResponse >
40
+ completionHandler: @escaping @ Sendable ProxyCompletionHandler < REST . SubmitVoucherResponse >
41
41
) -> Cancellable
42
42
}
43
43
44
44
extension REST {
45
- public final class APIProxy : Proxy < AuthProxyConfiguration > , APIQuerying {
45
+ public final class APIProxy : Proxy < AuthProxyConfiguration > , APIQuerying , @ unchecked Sendable {
46
46
public init ( configuration: AuthProxyConfiguration ) {
47
47
super. init (
48
48
name: " APIProxy " ,
@@ -57,7 +57,7 @@ extension REST {
57
57
58
58
public func getAddressList(
59
59
retryStrategy: REST . RetryStrategy ,
60
- completionHandler: @escaping ProxyCompletionHandler < [ AnyIPEndpoint ] >
60
+ completionHandler: @escaping @ Sendable ProxyCompletionHandler < [ AnyIPEndpoint ] >
61
61
) -> Cancellable {
62
62
let requestHandler = AnyRequestHandler { endpoint in
63
63
try self . requestFactory. createRequest (
@@ -84,7 +84,7 @@ extension REST {
84
84
public func getRelays(
85
85
etag: String ? ,
86
86
retryStrategy: REST . RetryStrategy ,
87
- completionHandler: @escaping ProxyCompletionHandler < ServerRelaysCacheResponse >
87
+ completionHandler: @escaping @ Sendable ProxyCompletionHandler < ServerRelaysCacheResponse >
88
88
) -> Cancellable {
89
89
let requestHandler = AnyRequestHandler { endpoint in
90
90
var requestBuilder = try self . requestFactory. createRequestBuilder (
@@ -240,7 +240,7 @@ extension REST {
240
240
voucherCode: String ,
241
241
accountNumber: String ,
242
242
retryStrategy: REST . RetryStrategy ,
243
- completionHandler: @escaping ProxyCompletionHandler < SubmitVoucherResponse >
243
+ completionHandler: @escaping @ Sendable ProxyCompletionHandler < SubmitVoucherResponse >
244
244
) -> Cancellable {
245
245
let requestHandler = AnyRequestHandler (
246
246
createURLRequest: { endpoint, authorization in
@@ -283,16 +283,16 @@ extension REST {
283
283
284
284
// MARK: - Response types
285
285
286
- public enum ServerRelaysCacheResponse {
286
+ public enum ServerRelaysCacheResponse : Sendable {
287
287
case notModified
288
288
case newContent( _ etag: String ? , _ rawData: Data )
289
289
}
290
290
291
- private struct CreateApplePaymentRequest : Encodable {
291
+ private struct CreateApplePaymentRequest : Encodable , Sendable {
292
292
let receiptString : Data
293
293
}
294
294
295
- public enum CreateApplePaymentResponse {
295
+ public enum CreateApplePaymentResponse : Sendable {
296
296
case noTimeAdded( _ expiry: Date )
297
297
case timeAdded( _ timeAdded: Int , _ newExpiry: Date )
298
298
@@ -322,12 +322,12 @@ extension REST {
322
322
}
323
323
}
324
324
325
- private struct CreateApplePaymentRawResponse : Decodable {
325
+ private struct CreateApplePaymentRawResponse : Decodable , Sendable {
326
326
let timeAdded : Int
327
327
let newExpiry : Date
328
328
}
329
329
330
- public struct ProblemReportRequest : Encodable {
330
+ public struct ProblemReportRequest : Encodable , Sendable {
331
331
public let address : String
332
332
public let message : String
333
333
public let log : String
@@ -341,11 +341,11 @@ extension REST {
341
341
}
342
342
}
343
343
344
- private struct SubmitVoucherRequest : Encodable {
344
+ private struct SubmitVoucherRequest : Encodable , Sendable {
345
345
let voucherCode : String
346
346
}
347
347
348
- public struct SubmitVoucherResponse : Decodable {
348
+ public struct SubmitVoucherResponse : Decodable , Sendable {
349
349
public let timeAdded : Int
350
350
public let newExpiry : Date
351
351
0 commit comments