mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 03:33:36 +01:00
Create swift package
This commit is contained in:
29
Sources/SideStoreCore/Patreon/Benefit.swift
Normal file
29
Sources/SideStoreCore/Patreon/Benefit.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Benefit.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 8/21/19.
|
||||
// Copyright © 2019 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public enum ALTPatreonBenefitType: String, Codable, Equatable, CaseIterable, Hashable {
|
||||
case betaAccess = "7585304"
|
||||
case credits = "8490206"
|
||||
}
|
||||
|
||||
extension PatreonAPI {
|
||||
struct BenefitResponse: Decodable {
|
||||
var id: String
|
||||
}
|
||||
}
|
||||
|
||||
public struct Benefit: Hashable {
|
||||
public var type: ALTPatreonBenefitType
|
||||
|
||||
init?(response: PatreonAPI.BenefitResponse) {
|
||||
guard let type = ALTPatreonBenefitType(rawValue: response.id) else { return nil }
|
||||
self.type = type
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user