Make various tweaks, mostly formatting and Id -> ID changes, to ReaderAPI.

This commit is contained in:
Brent Simmons
2024-04-06 13:14:03 -07:00
parent 5555ae5adc
commit fbc0c72cd5
8 changed files with 41 additions and 42 deletions

View File

@@ -100,7 +100,6 @@ public struct ReaderAPIEntry: Codable, Sendable {
return String(idNumber, radix: 10, uppercase: false)
}
}
public struct ReaderAPIArticleSummary: Codable, Sendable {
@@ -123,11 +122,11 @@ public struct ReaderAPIAlternateLocation: Codable, Sendable {
public struct ReaderAPIEntryOrigin: Codable, Sendable {
public let streamId: String?
public let streamID: String?
public let title: String?
enum CodingKeys: String, CodingKey {
case streamId = "streamId"
case streamID = "streamId"
case title = "title"
}
}

View File

@@ -18,16 +18,16 @@ import FoundationExtras
*/
public struct ReaderAPIQuickAddResult: Codable {
public struct ReaderAPIQuickAddResult: Codable, Sendable {
public let numResults: Int
public let error: String?
public let streamId: String?
public let streamID: String?
enum CodingKeys: String, CodingKey {
case numResults = "numResults"
case error = "error"
case streamId = "streamId"
case streamID = "streamId"
}
}
@@ -85,30 +85,31 @@ public struct ReaderAPISubscription: Codable, Sendable {
public struct ReaderAPICategory: Codable, Sendable {
public let categoryId: String
public let categoryID: String
public let categoryLabel: String
enum CodingKeys: String, CodingKey {
case categoryId = "id"
case categoryID = "id"
case categoryLabel = "label"
}
}
struct ReaderAPICreateSubscription: Codable {
let feedURL: String
public struct ReaderAPICreateSubscription: Codable, Sendable {
public let feedURL: String
enum CodingKeys: String, CodingKey {
case feedURL = "feed_url"
}
}
struct ReaderAPISubscriptionChoice: Codable {
let name: String?
let url: String
public struct ReaderAPISubscriptionChoice: Codable, Sendable {
public let name: String?
public let url: String
enum CodingKeys: String, CodingKey {
case name = "title"
case url = "feed_url"
}
}

View File

@@ -33,5 +33,4 @@ public struct ReaderAPITag: Codable, Sendable {
}
return String(tagID.suffix(from: range.upperBound))
}
}

View File

@@ -8,11 +8,11 @@
import Foundation
struct ReaderAPITagging: Codable {
public struct ReaderAPITagging: Codable, Sendable {
let taggingID: Int
let feedID: Int
let name: String
public let taggingID: Int
public let feedID: Int
public let name: String
enum CodingKeys: String, CodingKey {
case taggingID = "id"
@@ -22,11 +22,11 @@ struct ReaderAPITagging: Codable {
}
struct ReaderAPICreateTagging: Codable {
let feedID: Int
let name: String
public struct ReaderAPICreateTagging: Codable, Sendable {
public let feedID: Int
public let name: String
enum CodingKeys: String, CodingKey {
case feedID = "feed_id"
case name = "name"

View File

@@ -21,9 +21,9 @@ public struct ReaderAPIReferenceWrapper: Codable, Sendable {
public struct ReaderAPIReference: Codable, Sendable {
public let itemId: String?
public let itemID: String?
enum CodingKeys: String, CodingKey {
case itemId = "id"
case itemID = "id"
}
}

View File

@@ -7,7 +7,8 @@
import Foundation
public enum ReaderAPIVariant {
public enum ReaderAPIVariant: Sendable {
case generic
case freshRSS
case inoreader
@@ -26,5 +27,4 @@ public enum ReaderAPIVariant {
return ""
}
}
}