File tree Expand file tree Collapse file tree 6 files changed +108
-1
lines changed Expand file tree Collapse file tree 6 files changed +108
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,19 @@ extension WFUser: Decodable {
2323 case createdDate = " created "
2424 }
2525
26+ /// Creates a minimum `WFUser` object from a stored token.
27+ ///
28+ /// Use this when the client has already logged in a user and only needs to reconstruct the type from saved properties.
29+ ///
30+ /// - Parameter token: The user's access token
31+ /// - Parameter username: The user's username (optional)
32+ public init ( token: String , username: String ? ) {
33+ self . token = token
34+ if let username = username {
35+ self . username = username
36+ }
37+ }
38+
2639 /// Creates a `WFUser` object from the server response.
2740 ///
2841 /// Primarily used by the `WFClient` to create a `WFUser` object from the JSON returned by the server.
Original file line number Diff line number Diff line change 22
33 - [ WFClient] ( /WFClient )
44 - [ WFCollection] ( /WFCollection )
5+ - [ WFError] ( /WFError )
56 - [ WFPost] ( /WFPost )
67 - [ WFUser] ( /WFUser )
Original file line number Diff line number Diff line change 1+ # WFError
2+
3+ ``` swift
4+ public enum WFError
5+ ```
6+
7+ ## Inheritance
8+
9+ `Error`, `Int`
10+
11+ ## Enumeration Cases
12+
13+ ### `badRequest`
14+
15+ ``` swift
16+ case badRequest
17+ ```
18+
19+ ### `unauthorized`
20+
21+ ``` swift
22+ case unauthorized
23+ ```
24+
25+ ### `forbidden`
26+
27+ ``` swift
28+ case forbidden
29+ ```
30+
31+ ### `notFound`
32+
33+ ``` swift
34+ case notFound
35+ ```
36+
37+ ### `methodNotAllowed`
38+
39+ ``` swift
40+ case methodNotAllowed
41+ ```
42+
43+ ### `gone`
44+
45+ ``` swift
46+ case gone
47+ ```
48+
49+ ### `preconditionFailed`
50+
51+ ``` swift
52+ case preconditionFailed
53+ ```
54+
55+ ### `tooManyRequests`
56+
57+ ``` swift
58+ case tooManyRequests
59+ ```
60+
61+ ### `internalServerError`
62+
63+ ``` swift
64+ case internalServerError
65+ ```
66+
67+ ### `badGateway`
68+
69+ ``` swift
70+ case badGateway
71+ ```
72+
73+ ### `serviceUnavailable`
74+
75+ ``` swift
76+ case serviceUnavailable
77+ ```
Original file line number Diff line number Diff line change @@ -10,6 +10,21 @@ public struct WFUser
1010
1111## Initializers
1212
13+ ### `init(token:username :)`
14+
15+ Creates a minimum `WFUser` object from a stored token.
16+
17+ ``` swift
18+ public init(token: String , username : String ?)
19+ ```
20+
21+ Use this when the client has already logged in a user and only needs to reconstruct the type from saved properties.
22+
23+ #### Parameters
24+
25+ - token: - token : The user 's access token
26+ - username: - username : The user 's username (optional )
27+
1328### `init(from:)`
1429
1530Creates a `WFUser` object from the server response.
Original file line number Diff line number Diff line change 1- Generated at 2020-08-17T10:42:50 -0400 using [ swift-doc] ( https://github.com/SwiftDocOrg/swift-doc ) 1.0.0-beta.3.
1+ Generated at 2020-08-31T10:27:33 -0400 using [ swift-doc] ( https://github.com/SwiftDocOrg/swift-doc ) 1.0.0-beta.3.
Original file line number Diff line number Diff line change 33
44 - [ WFClient] ( /WFClient )
55 - [ WFCollection] ( /WFCollection )
6+ - [ WFError] ( /WFError )
67 - [ WFPost] ( /WFPost )
78 - [ WFUser] ( /WFUser )
89
You can’t perform that action at this time.
0 commit comments