mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
28 lines
456 B
Swift
28 lines
456 B
Swift
// Copyright 2018 Yandex LLC. All rights reserved.
|
|
|
|
public enum HTTPCode: CaseIterable {
|
|
case ok
|
|
case noContent
|
|
case forbidden
|
|
case notFound
|
|
case conflict
|
|
case unknown
|
|
|
|
public init(value: Int) {
|
|
switch value {
|
|
case 200:
|
|
self = .ok
|
|
case 204:
|
|
self = .noContent
|
|
case 403:
|
|
self = .forbidden
|
|
case 404:
|
|
self = .notFound
|
|
case 409:
|
|
self = .conflict
|
|
default:
|
|
self = .unknown
|
|
}
|
|
}
|
|
}
|