metatext/Shared/Networking/Mastodon API/MastodonAPI.swift
2020-07-31 00:13:54 -07:00

29 lines
723 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
struct MastodonAPI {
static let dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
struct OAuth {
static let clientName = "Metatext"
static let scopes = "read write follow push"
static let codeCallbackQueryItemName = "code"
static let grantType = "authorization_code"
static let callbackURLScheme = "metatext"
}
enum OAuthError {
case codeNotFound
}
}
extension MastodonAPI.OAuthError: LocalizedError {
var errorDescription: String? {
switch self {
case .codeNotFound:
return NSLocalizedString("oauth.error.code-not-found", comment: "")
}
}
}