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