frenzy-ios/Fervor/ClientRegistration.swift

26 lines
677 B
Swift

//
// ClientRegistration.swift
// Fervor
//
// Created by Shadowfacts on 11/25/21.
//
import Foundation
public struct ClientRegistration: Decodable, Sendable {
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"
}
}