All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.afrozaar.wordpress.wpapi.v2.api.Posts Maven / Gradle / Ivy

There is a newer version: 4.8.3
Show newest version
package com.afrozaar.wordpress.wpapi.v2.api;

import com.afrozaar.wordpress.wpapi.v2.exception.PostCreateException;
import com.afrozaar.wordpress.wpapi.v2.exception.PostNotFoundException;
import com.afrozaar.wordpress.wpapi.v2.model.Post;
import com.afrozaar.wordpress.wpapi.v2.model.PostStatus;
import com.afrozaar.wordpress.wpapi.v2.request.Request;
import com.afrozaar.wordpress.wpapi.v2.request.SearchRequest;

import java.util.Map;

public interface Posts {

    /**
     * @param post   {@code Map}
     * @param status
     * @return Created {@link Post}
     * @throws PostCreateException
     * @see Create a Post - v1 documentation
     * 
     *     status - Post status of the post:
     *     * draft,
     *     * publish,
     *     * pending,
     *     * future,
     *     * private
     *      or any custom registered status.
     *     If providing a status of future, you must specify a date in order for the post to be published as expected.
     *     Default is draft. (string) optional
     * 
*/ Post createPost(Map post, PostStatus status) throws PostCreateException; Post createPost(Post post, PostStatus status) throws PostCreateException; Post getPost(Long id) throws PostNotFoundException; /** *
     * PUT /post/{id}
     * 
*/ Post updatePost(Post post); Post updatePostField(Long postId, String field, Object value); Post deletePost(Post post); /** * Search request just returning the first page of posts. */ static SearchRequest list() { return SearchRequest.Builder.aSearchRequest(Post.class) .withUri(Request.POSTS) .build(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy