@@ -11,6 +11,11 @@ public enum ReaderSortingOption: String, CaseIterable {
1111 }
1212}
1313
14+ public enum ReaderStream : String {
15+ case discover = " discover "
16+ case firstPosts = " first-posts "
17+ }
18+
1419extension ReaderPostServiceRemote {
1520 /// Returns a collection of RemoteReaderCard using the tags API
1621 /// a Reader Card can represent an item for the reader feed, such as
@@ -46,22 +51,22 @@ extension ReaderPostServiceRemote {
4651 /// - Topics you may like
4752 /// - Blogs you may like and so on
4853 ///
49- /// - Parameter stream: The name of the stream. By default, `discover`.
54+ /// - Parameter stream: The name of the stream. By default, `. discover`.
5055 /// - Parameter topics: an array of String representing the topics
5156 /// - Parameter page: a String that represents a page handle
5257 /// - Parameter sortingOption: a ReaderSortingOption that represents a sorting option
5358 /// - Parameter count: the number of cards to fetch. Warning: This also changes the number of objects returned for recommended sites/tags.
5459 /// - Parameter success: Called when the request succeeds and the data returned is valid
5560 /// - Parameter failure: Called if the request fails for any reason, or the response data is invalid
56- public func fetchStreamCards( stream: String = " discover " ,
61+ public func fetchStreamCards( stream: ReaderStream = . discover,
5762 for topics: [ String ] ,
5863 page: String ? = nil ,
5964 sortingOption: ReaderSortingOption = . noSorting,
6065 refreshCount: Int ? = nil ,
6166 count: Int ? = nil ,
6267 success: @escaping ( [ RemoteReaderCard ] , String ? ) -> Void ,
6368 failure: @escaping ( Error ) -> Void ) {
64- let path = " read/streams/ \( stream) "
69+ let path = " read/streams/ \( stream. rawValue ) "
6570 guard let requestUrl = cardsEndpoint ( with: path,
6671 topics: topics,
6772 page: page,
0 commit comments