frenzy-ios/Fervor/ClientRegistration.swift

26 lines
677 B
Swift
Raw Normal View History

2021-12-08 02:58:02 +00:00
//
// ClientRegistration.swift
// Fervor
//
// Created by Shadowfacts on 11/25/21.
//
import Foundation
public struct ClientRegistration: Decodable, Sendable {
2021-12-08 02:58:02 +00:00
public let clientID: String
public let clientSecret: String
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.clientID = try container.decode(String.self, forKey: .clientID)
self.clientSecret = try container.decode(String.self, forKey: .clientSecret)
}
private enum CodingKeys: String, CodingKey {
case clientID = "client_id"
case clientSecret = "client_secret"
}
}