From 756bf171753ffdc1abeef970f3f2ab9cbf46524d Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 12 Sep 2023 21:37:25 -0700 Subject: [PATCH] Rename FeedlyFeedResourceId to FeedlyFeedResourceID. --- .../Account/Feedly/FeedlyAPICaller.swift | 2 +- .../Feedly/FeedlyAccountDelegate.swift | 6 +++--- .../Feedly/FeedlyResourceProviding.swift | 2 +- .../Feedly/Models/FeedlyFeedParser.swift | 2 +- .../Feedly/Models/FeedlyResourceId.swift | 20 +++++++++---------- .../FeedlyAddExistingFeedOperation.swift | 2 +- .../FeedlyAddFeedToCollectionOperation.swift | 6 +++--- .../FeedlyAddNewFeedOperation.swift | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Account/Sources/Account/Feedly/FeedlyAPICaller.swift b/Account/Sources/Account/Feedly/FeedlyAPICaller.swift index fdea88fe2..cd546428c 100644 --- a/Account/Sources/Account/Feedly/FeedlyAPICaller.swift +++ b/Account/Sources/Account/Feedly/FeedlyAPICaller.swift @@ -389,7 +389,7 @@ final class FeedlyAPICaller { extension FeedlyAPICaller: FeedlyAddFeedToCollectionService { - func addFeed(with feedId: FeedlyFeedResourceId, title: String? = nil, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> ()) { + func addFeed(with feedId: FeedlyFeedResourceID, title: String? = nil, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> ()) { guard !isSuspended else { return DispatchQueue.main.async { completion(.failure(TransportError.suspended)) diff --git a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index 6ae3a1a8f..33b81f666 100644 --- a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -352,7 +352,7 @@ final class FeedlyAccountDelegate: AccountDelegate, Logging { throw FeedlyAccountDelegateError.unableToRenameFeed(feed.nameForDisplay, name) } - let feedID = FeedlyFeedResourceId(id: feed.feedID) + let feedID = FeedlyFeedResourceID(id: feed.feedID) let editedNameBefore = feed.editedName // optimistically set the name @@ -383,7 +383,7 @@ final class FeedlyAccountDelegate: AccountDelegate, Logging { return } - let feedId = FeedlyFeedResourceId(id: feed.feedID) + let feedId = FeedlyFeedResourceID(id: feed.feedID) let editedNameBefore = feed.editedName // Adding an existing feed updates it. @@ -410,7 +410,7 @@ final class FeedlyAccountDelegate: AccountDelegate, Logging { throw FeedlyAccountDelegateError.notLoggedIn } - let resource = FeedlyFeedResourceId(id: feed.feedID) + let resource = FeedlyFeedResourceID(id: feed.feedID) let addExistingFeed = try FeedlyAddExistingFeedOperation(account: account, credentials: credentials, resource: resource, diff --git a/Account/Sources/Account/Feedly/FeedlyResourceProviding.swift b/Account/Sources/Account/Feedly/FeedlyResourceProviding.swift index 967d09e5c..cfc4d5ef0 100644 --- a/Account/Sources/Account/Feedly/FeedlyResourceProviding.swift +++ b/Account/Sources/Account/Feedly/FeedlyResourceProviding.swift @@ -12,7 +12,7 @@ protocol FeedlyResourceProviding { var resource: FeedlyResourceID { get } } -extension FeedlyFeedResourceId: FeedlyResourceProviding { +extension FeedlyFeedResourceID: FeedlyResourceProviding { var resource: FeedlyResourceID { return self diff --git a/Account/Sources/Account/Feedly/Models/FeedlyFeedParser.swift b/Account/Sources/Account/Feedly/Models/FeedlyFeedParser.swift index a9faf3f25..45ec69244 100644 --- a/Account/Sources/Account/Feedly/Models/FeedlyFeedParser.swift +++ b/Account/Sources/Account/Feedly/Models/FeedlyFeedParser.swift @@ -22,7 +22,7 @@ struct FeedlyFeedParser { } var url: String { - let resource = FeedlyFeedResourceId(id: feed.id) + let resource = FeedlyFeedResourceID(id: feed.id) return resource.url } diff --git a/Account/Sources/Account/Feedly/Models/FeedlyResourceId.swift b/Account/Sources/Account/Feedly/Models/FeedlyResourceId.swift index aaf976f1d..98b3cd256 100644 --- a/Account/Sources/Account/Feedly/Models/FeedlyResourceId.swift +++ b/Account/Sources/Account/Feedly/Models/FeedlyResourceId.swift @@ -16,7 +16,7 @@ protocol FeedlyResourceID { } /// The Feed Resource is documented here: https://developer.feedly.com/cloud/ -struct FeedlyFeedResourceId: FeedlyResourceID { +struct FeedlyFeedResourceID: FeedlyResourceID { let id: String /// The location of the kind of resource a concrete type represents. @@ -38,7 +38,7 @@ struct FeedlyFeedResourceId: FeedlyResourceID { } } -extension FeedlyFeedResourceId { +extension FeedlyFeedResourceID { init(url: String) { self.id = "feed/\(url)" } @@ -49,23 +49,23 @@ struct FeedlyCategoryResourceID: FeedlyResourceID { enum Global { - static func uncategorized(for userId: String) -> FeedlyCategoryResourceID { + static func uncategorized(for userID: String) -> FeedlyCategoryResourceID { // https://developer.feedly.com/cloud/#global-resource-ids - let id = "user/\(userId)/category/global.uncategorized" + let id = "user/\(userID)/category/global.uncategorized" return FeedlyCategoryResourceID(id: id) } /// All articles from all the feeds the user subscribes to. - static func all(for userId: String) -> FeedlyCategoryResourceID { + static func all(for userID: String) -> FeedlyCategoryResourceID { // https://developer.feedly.com/cloud/#global-resource-ids - let id = "user/\(userId)/category/global.all" + let id = "user/\(userID)/category/global.all" return FeedlyCategoryResourceID(id: id) } /// All articles from all the feeds the user loves most. - static func mustRead(for userId: String) -> FeedlyCategoryResourceID { + static func mustRead(for userID: String) -> FeedlyCategoryResourceID { // https://developer.feedly.com/cloud/#global-resource-ids - let id = "user/\(userId)/category/global.must" + let id = "user/\(userID)/category/global.must" return FeedlyCategoryResourceID(id: id) } } @@ -76,9 +76,9 @@ struct FeedlyTagResourceId: FeedlyResourceID { enum Global { - static func saved(for userId: String) -> FeedlyTagResourceId { + static func saved(for userID: String) -> FeedlyTagResourceId { // https://developer.feedly.com/cloud/#global-resource-ids - let id = "user/\(userId)/tag/global.saved" + let id = "user/\(userID)/tag/global.saved" return FeedlyTagResourceId(id: id) } } diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift index 7df86127a..bfabe5f69 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift @@ -16,7 +16,7 @@ class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, private let operationQueue = MainThreadOperationQueue() var addCompletionHandler: ((Result) -> ())? - init(account: Account, credentials: Credentials, resource: FeedlyFeedResourceId, service: FeedlyAddFeedToCollectionService, container: Container, progress: DownloadProgress, customFeedName: String? = nil) throws { + init(account: Account, credentials: Credentials, resource: FeedlyFeedResourceID, service: FeedlyAddFeedToCollectionService, container: Container, progress: DownloadProgress, customFeedName: String? = nil) throws { let validator = FeedlyFeedContainerValidator(container: container) let (folder, collectionId) = try validator.getValidContainer() diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyAddFeedToCollectionOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyAddFeedToCollectionOperation.swift index 3ee5e854e..db2f479a9 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyAddFeedToCollectionOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyAddFeedToCollectionOperation.swift @@ -10,7 +10,7 @@ import Foundation import AccountError protocol FeedlyAddFeedToCollectionService { - func addFeed(with feedId: FeedlyFeedResourceId, title: String?, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> ()) + func addFeed(with feedId: FeedlyFeedResourceID, title: String?, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> ()) } final class FeedlyAddFeedToCollectionOperation: FeedlyOperation, FeedlyFeedsAndFoldersProviding, FeedlyResourceProviding { @@ -20,9 +20,9 @@ final class FeedlyAddFeedToCollectionOperation: FeedlyOperation, FeedlyFeedsAndF let service: FeedlyAddFeedToCollectionService let account: Account let folder: Folder - let feedResource: FeedlyFeedResourceId + let feedResource: FeedlyFeedResourceID - init(account: Account, folder: Folder, feedResource: FeedlyFeedResourceId, feedName: String? = nil, collectionId: String, service: FeedlyAddFeedToCollectionService) { + init(account: Account, folder: Folder, feedResource: FeedlyFeedResourceID, feedName: String? = nil, collectionId: String, service: FeedlyAddFeedToCollectionService) { self.account = account self.folder = folder self.feedResource = feedResource diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift index 4f162c955..4c594b194 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift @@ -26,7 +26,7 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl private let addToCollectionService: FeedlyAddFeedToCollectionService private let syncUnreadIdsService: FeedlyGetStreamIDsService private let getStreamContentsService: FeedlyGetStreamContentsService - private var feedResourceId: FeedlyFeedResourceId? + private var feedResourceId: FeedlyFeedResourceID? var addCompletionHandler: ((Result) -> ())? init(account: Account, credentials: Credentials, url: String, feedName: String?, searchService: FeedlySearchService, addToCollectionService: FeedlyAddFeedToCollectionService, syncUnreadIdsService: FeedlyGetStreamIDsService, getStreamContentsService: FeedlyGetStreamContentsService, database: SyncDatabase, container: Container, progress: DownloadProgress) throws { @@ -81,7 +81,7 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl return didFinish(with: AccountError.createErrorNotFound) } - let feedResourceId = FeedlyFeedResourceId(id: first.feedId) + let feedResourceId = FeedlyFeedResourceID(id: first.feedId) self.feedResourceId = feedResourceId let addRequest = FeedlyAddFeedToCollectionOperation(account: account, folder: folder, feedResource: feedResourceId, feedName: feedName, collectionId: collectionId, service: addToCollectionService)