mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
35 lines
695 B
Swift
35 lines
695 B
Swift
//
|
|
// Benefit.swift
|
|
// AltStore
|
|
//
|
|
// Created by Riley Testut on 8/21/19.
|
|
// Copyright © 2019 Riley Testut. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension PatreonAPI
|
|
{
|
|
typealias BenefitResponse = DataResponse<BenefitAttributes, AnyRelationships>
|
|
|
|
struct BenefitAttributes: Decodable
|
|
{
|
|
var title: String
|
|
}
|
|
}
|
|
|
|
extension PatreonAPI
|
|
{
|
|
public struct Benefit: Hashable
|
|
{
|
|
public var name: String
|
|
public var identifier: ALTPatreonBenefitID
|
|
|
|
internal init(response: BenefitResponse)
|
|
{
|
|
self.name = response.attributes.title
|
|
self.identifier = ALTPatreonBenefitID(response.id)
|
|
}
|
|
}
|
|
}
|