NetNewsWire/Frameworks/Account/Feedbin/FeedbinSubscription.swift

75 lines
1.4 KiB
Swift
Raw Normal View History

2017-12-10 22:58:44 +01:00
//
// FeedbinFeed.swift
2017-12-10 22:58:44 +01:00
// Account
//
// Created by Brent Simmons on 12/10/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
//
import Foundation
import RSCore
import RSParser
struct FeedbinSubscription: Hashable, Codable {
2017-12-10 22:58:44 +01:00
let subscriptionID: Int
let feedID: Int
let name: String?
let url: String
let homePageURL: String?
let jsonFeed: FeedbinSubscriptionJSONFeed?
2019-05-05 10:25:21 +02:00
enum CodingKeys: String, CodingKey {
case subscriptionID = "id"
case feedID = "feed_id"
case name = "title"
case url = "feed_url"
case homePageURL = "site_url"
case jsonFeed = "json_feed"
2017-12-10 22:58:44 +01:00
}
public func hash(into hasher: inout Hasher) {
hasher.combine(subscriptionID)
}
static func == (lhs: FeedbinSubscription, rhs: FeedbinSubscription) -> Bool {
return lhs.subscriptionID == rhs.subscriptionID
}
}
struct FeedbinSubscriptionJSONFeed: Codable {
let favicon: String?
let icon: String?
enum CodingKeys: String, CodingKey {
case favicon = "favicon"
case icon = "icon"
}
2017-12-10 22:58:44 +01:00
}
2019-05-08 13:56:15 +02:00
struct FeedbinCreateSubscription: Codable {
let feedURL: String
enum CodingKeys: String, CodingKey {
case feedURL = "feed_url"
}
2019-05-09 00:41:19 +02:00
}
2019-05-08 13:56:15 +02:00
2019-05-09 00:41:19 +02:00
struct FeedbinUpdateSubscription: Codable {
let title: String
enum CodingKeys: String, CodingKey {
case title
}
2019-05-08 13:56:15 +02:00
}
struct FeedbinSubscriptionChoice: Codable {
let name: String?
let url: String
enum CodingKeys: String, CodingKey {
case name = "title"
case url = "feed_url"
}
}