metatext/Development Assets/Mastodon API Stubs/AccessTokenEndpoint+Stubbing.swift
Justin Mazzocchi 9b59e2fbea
wip
2020-08-30 16:33:32 -07:00

20 lines
533 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
import Mastodon
extension AccessTokenEndpoint: Stubbing {
func dataString(url: URL) -> String? {
switch self {
case let .oauthToken(_, _, _, _, scopes, _):
return """
{
"access_token": "ACCESS_TOKEN_STUB_VALUE",
"token_type": "Bearer",
"scope": "\(scopes)",
"created_at": "\(Int(Date().timeIntervalSince1970))"
}
"""
}
}
}