2019-08-28 11:13:22 -07:00
|
|
|
//
|
|
|
|
|
// Campaign.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 CampaignResponse = DataResponse<CampaignAttributes, AnyRelationships>
|
|
|
|
|
|
|
|
|
|
struct CampaignAttributes: Decodable
|
2019-08-28 11:13:22 -07:00
|
|
|
{
|
2023-11-15 14:13:58 -06:00
|
|
|
var url: URL
|
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 Campaign
|
2019-08-28 11:13:22 -07:00
|
|
|
{
|
2023-11-15 14:13:58 -06:00
|
|
|
public var identifier: String
|
|
|
|
|
public var url: URL
|
|
|
|
|
|
|
|
|
|
internal init(response: PatreonAPI.CampaignResponse)
|
|
|
|
|
{
|
|
|
|
|
self.identifier = response.id
|
|
|
|
|
self.url = response.attributes.url
|
|
|
|
|
}
|
2019-08-28 11:13:22 -07:00
|
|
|
}
|
|
|
|
|
}
|