You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/ComposableArchitecturePattern/Server+API.swift
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,35 @@
7
7
8
8
import Foundation
9
9
10
+
/// An object that specifies a specific server API.
11
+
///
12
+
/// - Note: It is highly encouraged to define your `supportedReturnObjects` to ensure `-supports<T: Codable>(_:)` is able to automatically verify against this.
10
13
publicprotocolServerAPI:Identifiable,Equatable{
14
+
/// The environment this API should be used against. Default is `nil`.
15
+
/// - Note: If it can be used against any environment, leave it `nil`.
11
16
varenvironment:ServerEnvironment?{getset}
17
+
18
+
/// The path this API corresponds to.
12
19
varpath:String{getset}
20
+
21
+
/// The headers required for this API. Default is `nil`.
13
22
varheaders:[String:String]?{getset}
23
+
24
+
/// The queries required for this API. Default is `nil`.
14
25
varqueries:[URLQueryItem]?{getset}
26
+
27
+
/// Data to send in the request's body.
15
28
varbody:Data?{getset}
29
+
30
+
/// All HTTP methods this API supports.
16
31
varsupportedHTTPMethods:[HTTPMethod]{getset}
32
+
33
+
/// All the return objects this API supports. Default is `nil`.
34
+
///
35
+
/// This helps ensure a non-supported object isn't attempted to be used with the API.
17
36
varsupportedReturnObjects:[Codable.Type]?{getset}
37
+
38
+
/// The timeout length for the request. Default is `60`.
18
39
vartimeoutInterval:TimeInterval{getset}
19
40
/// Whether to block this API if the server is attempting to use a different environment.
0 commit comments