Package com.buttercms

Interface IButterCMSClient

All Known Implementing Classes:
ButterCMSClient

public interface IButterCMSClient
  • Method Details

    • getAuthToken

      String getAuthToken()
      Returns:
      current auth_token
    • setAuthToken

      void setAuthToken​(String authToken)
      sets new auth_token
      Parameters:
      authToken - new auth_token
    • getAuthor

      AuthorResponse getAuthor​(String slug, Map<String,​String> queryParameters)
      Retrieves an author’s information
      Parameters:
      slug - the slug of the author to be retrieved.
      queryParameters - query parameters as described in https://buttercms.com/docs/api/#authors
      Returns:
      author object
    • getAuthors

      AuthorsResponse getAuthors​(Map<String,​String> queryParameters)
      Retrieves a list of authors
      Parameters:
      queryParameters - query parameters as described in https://buttercms.com/docs/api/#authors
      Returns:
      a list of authors
    • getCategory

      CategoryResponse getCategory​(String slug, Map<String,​String> queryParameters)
      Retrieves the details of a category
      Parameters:
      slug - The slug of the category to be retrieved
      queryParameters - query parameters as described in https://buttercms.com/docs/api/#categories
      Returns:
      a category object
    • getCategories

      CategoriesResponse getCategories​(Map<String,​String> queryParameters)
      Returns a list of blog categories. You can include each category’s posts using the include=recent_posts query parameter.
      Parameters:
      queryParameters - query parameters as described in https://buttercms.com/docs/api/#categories
      Returns:
      an array of categories
    • getPage

      <T> PageResponse<T> getPage​(String pageTypeSlug, String pageSlug, Map<String,​String> queryParameters, Class<T> classType)
      Get a single Page using its slug
      Parameters:
      pageTypeSlug - Use '*'. If limiting to a Page Type, use the Page Type slug.
      pageSlug - The slug of the page.
      queryParameters - query parameters as described in https://buttercms.com/docs/api/#get-a-single-page
      classType - Object that Page should be deserialize in to
      Returns:
      A single page
    • getPages

      <T> PagesResponse<T> getPages​(String pageTypeSlug, Map<String,​String> queryParameters, Class<T> classType)
      Get a list of all pages for a given Page Type using its slug.
      Parameters:
      pageTypeSlug - The slug of the type of pages you want to retrieve
      queryParameters - query parameters as described in https://buttercms.com/docs/api/#get-multiple-pages-(page-type)
      classType - Object that Page should be deserialize in to
      Returns:
      A list of pages
    • getSearchPages

      <T> PagesResponse<T> getSearchPages​(String pageTypeSlug, Map<String,​String> queryParameters, Class<T> classType)
      Get a list of all pages for a given Page Type using its slug.
      Parameters:
      pageTypeSlug - The slug of the type of pages you want to retrieve
      queryParameters - query parameters as described in https://buttercms.com/docs/api/#search-pages
      classType - Object that Page should be deserialize in to
      Returns:
      A list of pages
    • getPost

      PostResponse getPost​(String slug)
      Get your Blog Post
      Parameters:
      slug - The slug of post
      Returns:
      a single post
    • getPosts

      PostsResponse getPosts​(Map<String,​String> queryParameters)
      Returns a list of published posts. The posts are returned sorted by publish date, with the most recent posts appearing first. The endpoint supports pagination and filtering.
      Parameters:
      queryParameters - query parameters as described in https://buttercms.com/docs/api/?shell#get-your-blog-posts
      Returns:
      a list of posts
    • getSearchPosts

      PostsResponse getSearchPosts​(Map<String,​String> queryParameters)
      Returns a list of published posts searched by the given 'query' search term. The posts are returned sorted by publish date, with the most recent posts appearing first. The endpoint supports pagination and filtering.
      Parameters:
      queryParameters - query parameters as described in https://buttercms.com/docs/api/?shell#search-posts
      Returns:
      a list of posts
    • getTag

      TagResponse getTag​(String slug, Map<String,​String> queryParameters)
      Retrieves the details of a tag
      Parameters:
      slug - Unique identifier
      queryParameters - query parameters as described in https://buttercms.com/docs/api/?shell#tags
      Returns:
      a single tag object
    • getTags

      TagsResponse getTags​(Map<String,​String> queryParameters)
      Returns a list of blog tags. You can incude each tags’s posts using the include=recent_posts query parameter.
      Parameters:
      queryParameters - query parameters as described in https://buttercms.com/docs/api/?shell#tags
      Returns:
      a list of blog tags
    • getSiteMap

      Document getSiteMap()
      Returns:
      site map
    • getCollection

      <T> CollectionResponse<T> getCollection​(String collectionSlug, Map<String,​String> queryParameters, Class<T> classType)
      Returns values for the supplied Collection slug
      Parameters:
      collectionSlug - The slug of collection
      queryParameters - query parameters as described in https://buttercms.com/docs/api/#retrieve-a-collection
      classType - Object that Collection item should be deserialize in to
      Returns:
      a single collection
    • getRSS

      Document getRSS()
      Returns:
      an RSS feed
    • getAtom

      Document getAtom()
      Returns:
      an ATOM feed