2019-08-28 11:13:22 -07:00
|
|
|
//
|
|
|
|
|
// Benefit.swift
|
|
|
|
|
// AltStore
|
|
|
|
|
//
|
|
|
|
|
// Created by Riley Testut on 8/21/19.
|
|
|
|
|
// Copyright © 2019 Riley Testut. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
|
|
extension PatreonAPI
|
|
|
|
|
{
|
2023-11-15 14:13:58 -06:00
|
|
|
typealias BenefitResponse = DataResponse<BenefitAttributes, AnyRelationships>
|
|
|
|
|
|
|
|
|
|
struct BenefitAttributes: Decodable
|
2019-08-28 11:13:22 -07:00
|
|
|
{
|
2023-11-15 14:13:58 -06:00
|
|
|
var title: String
|
2019-08-28 11:13:22 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-15 14:13:58 -06:00
|
|
|
extension PatreonAPI
|
2019-08-28 11:13:22 -07:00
|
|
|
{
|
2023-11-15 14:13:58 -06:00
|
|
|
public struct Benefit: Hashable
|
2019-08-28 11:13:22 -07:00
|
|
|
{
|
2023-11-15 14:13:58 -06:00
|
|
|
public var name: String
|
|
|
|
|
public var identifier: ALTPatreonBenefitID
|
|
|
|
|
|
|
|
|
|
internal init(response: BenefitResponse)
|
|
|
|
|
{
|
|
|
|
|
self.name = response.attributes.title
|
|
|
|
|
self.identifier = ALTPatreonBenefitID(response.id)
|
|
|
|
|
}
|
2019-08-28 11:13:22 -07:00
|
|
|
}
|
|
|
|
|
}
|