NewsFeedAPI
public enum NewsFeedAPI
                Caseless enumeration with static methods to send News Feed Requests
- 
                  
                  
Sends a request to get flags from the API.
Declaration
Swift
public static func getFlags(completion: ResponseCompletion<[Post.Flag]> = nil)Parameters
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to get posts from the API.
Declaration
Swift
public static func getPosts(with parameters: Parameters?, completion: ResponseCompletion<NewsFeed> = nil)Parameters
parametersThe
Parametersto apply. Commonly used parameter keys for posts list is:completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to get a specific post with ID.
Declaration
Swift
public static func getPost(id: String, completion: ResponseCompletion<Post> = nil)Parameters
idID of the post that will be fetched.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to create a new post in a specific feed.
Declaration
Swift
public static func addNewPost(body: String, assets: [URL], feedName: String?, completion: ResponseCompletion<Post> = nil)Parameters
bodyThe content of the post.
assetsThe attachments of the post.
feedNameThe name of the feed in which the new post will be created.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to delete a specific post with ID.
Declaration
Swift
public static func deletePost(id: String, completion: ResponseCompletion<Bool> = nil)Parameters
idID of the post that will be deleted.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to like a specific post with ID.
Declaration
Swift
public static func likePost(id: String, completion: ResponseCompletion<Bool> = nil)Parameters
idID of the post that will be liked.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to unlike a specific post with ID.
Declaration
Swift
public static func unlikePost(id: String, completion: ResponseCompletion<Bool> = nil)Parameters
idID of the post that will be unliked.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to flag a specific post with ID.
Declaration
Swift
public static func flagPost(flag: String, id: String, completion: ResponseCompletion<Bool> = nil)Parameters
flagKey of
Post.Flagobject.idID of the post that will be flagged.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to unflag a specific post with ID.
Declaration
Swift
public static func unflagPost(id: String, completion: ResponseCompletion<Bool> = nil)Parameters
idID of the post that will be unflagged.
completionThe closure to be executed once the request has finished.
 
- 
                  
                  
Sends a request to get comments in a specific comment for a page.
Declaration
Swift
public static func getComments(postId: String, with parameters: Parameters? = nil, completion: ResponseCompletion<[Comment]> = nil)Parameters
postIdID of the post.
parametersThe
Parametersto apply. Commonly used parameter keys for posts list is:completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to create a new comment in a specific post.
Declaration
Swift
public static func addNewComment(body: String, postId: String, completion: ResponseCompletion<Bool> = nil)Parameters
bodyThe content of the comment.
postIdID of the post in which the new comment will be created.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to delete a specific comment with ID.
Declaration
Swift
public static func deleteComment(withId id: String, postId: String, completion: ResponseCompletion<Bool> = nil)Parameters
idID of the comment that will be deleted.
postIdID of the post in which the comment will be deleted.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to like a specific comment with ID.
Declaration
Swift
public static func likeComment(id: String, postId: String, completion: ResponseCompletion<Bool> = nil)Parameters
idID of the comment that will be liked.
postIdID of the post in which the comment will be liked.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to unlike a specific comment with ID.
Declaration
Swift
public static func unlikeComment(id: String, postId: String, completion: ResponseCompletion<Bool> = nil)Parameters
idID of the comment that will be unliked.
postIdID of the post in which the comment will be unliked.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to flag a specific comment with ID.
Declaration
Swift
public static func flagComment(id: String, postId: String, flag: String, completion: ResponseCompletion<Bool> = nil)Parameters
flagKey of
Post.Flagobject.idID of the comment that will be flagged.
postIdID of the post in which the comment will be flagged.
completionThe closure to be executed once the request has finished.
 - 
                  
                  
Sends a request to unflag a specific comment with ID.
Declaration
Swift
public static func unflagComment(id: String, postId: String, completion: ResponseCompletion<Bool> = nil)Parameters
idID of the comment that will be unflagged.
postIdID of the post in which the comment will be unflagged.
completionThe closure to be executed once the request has finished.
 
View on GitHub
        NewsFeedAPI Enumeration Reference