NetNewsWire/Frameworks/Account/GoogleReaderCompatible/GoogleReaderCompatibleSubsc...

92 lines
1.8 KiB
Swift
Raw Normal View History

//
// GoogleReaderCompatibleFeed.swift
// Account
//
// Created by Brent Simmons on 12/10/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
//
import Foundation
import RSCore
import RSParser
2019-06-01 14:08:19 +02:00
struct GoogleReaderCompatibleSubscriptionContainer: Codable {
let subscriptions: [GoogleReaderCompatibleSubscription]
enum CodingKeys: String, CodingKey {
case subscriptions = "subscriptions"
}
}
/*
{
"id": "feed/1",
"title": "Questionable Content",
"categories": [
{
"id": "user/-/label/Comics",
"label": "Comics"
}
],
"url": "http://www.questionablecontent.net/QCRSS.xml",
"htmlUrl": "http://www.questionablecontent.net",
"iconUrl": "https://rss.confusticate.com/f.php?24decabc"
}
*/
struct GoogleReaderCompatibleSubscription: Codable {
2019-06-01 14:08:19 +02:00
let feedID: String
let name: String?
2019-06-01 14:08:19 +02:00
let categories: [GoogleReaderCompatibleCategory]
let url: String
let homePageURL: String?
2019-06-01 14:08:19 +02:00
let iconURL: String?
enum CodingKeys: String, CodingKey {
2019-06-01 14:08:19 +02:00
case feedID = "id"
case name = "title"
2019-06-01 14:08:19 +02:00
case categories = "categories"
case url = "url"
case homePageURL = "htmlUrl"
case iconURL = "iconUrl"
}
}
2019-06-01 14:08:19 +02:00
struct GoogleReaderCompatibleCategory: Codable {
let categoryId: String
let categoryLabel: String
enum CodingKeys: String, CodingKey {
case categoryId = "id"
case categoryLabel = "label"
}
}
struct GoogleReaderCompatibleCreateSubscription: Codable {
let feedURL: String
enum CodingKeys: String, CodingKey {
case feedURL = "feed_url"
}
}
struct GoogleReaderCompatibleUpdateSubscription: Codable {
let title: String
enum CodingKeys: String, CodingKey {
case title
}
}
struct GoogleReaderCompatibleSubscriptionChoice: Codable {
let name: String?
let url: String
enum CodingKeys: String, CodingKey {
case name = "title"
case url = "feed_url"
}
}