Created
July 20, 2020 05:18
-
-
Save charlesmuchene/7236c60ac8c7a8be1d909138cb7dbefb to your computer and use it in GitHub Desktop.
Sample status code entity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct StatusCode: CustomStringConvertible, Equatable { | |
let code: Int | |
var description: String | |
static let ok = StatusCode(code: 200, description: "Success") | |
static let unauthorized = StatusCode(code: 403, description: "Unauthorized") | |
static let invalidCredentials = StatusCode(code: 401, description: "Invalid credentials") | |
static func == (lhs: Int, rhs: StatusCode) -> Bool { | |
return lhs == rhs.code | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment