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

facebook4j.api.QuestionMethods Maven / Gradle / Ivy

There is a newer version: 2.4.13
Show newest version
/*
 * Copyright 2012 Ryuji Yamashita
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package facebook4j.api;

import facebook4j.FacebookException;
import facebook4j.Question;
import facebook4j.QuestionUpdate;
import facebook4j.QuestionVotes;
import facebook4j.Reading;
import facebook4j.ResponseList;

/**
 * @author Ryuji Yamashita - roundrop at gmail.com
 */
public interface QuestionMethods {
    /**
     * Returns the current user's/page's questions.
     * @return questions
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#questions - Facebook Developers
     */
    ResponseList getQuestions() throws FacebookException;

    /**
     * Returns the current user's/page's questions.
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return questions
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#questions - Facebook Developers
     */
    ResponseList getQuestions(Reading reading) throws FacebookException;

    /**
     * Returns a user's/page's questions.
     * @param id the ID of a user/page
     * @return questions
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#questions - Facebook Developers
     */
    ResponseList getQuestions(String id) throws FacebookException;

    /**
     * Returns a user's/page's questions.
     * @param id the ID of a user/page
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return questions
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#questions - Facebook Developers
     */
    ResponseList getQuestions(String id, Reading reading) throws FacebookException;


    /**
     * Creates a current page's question.
     * @param questionUpdate the question to be created
     * @return The new question ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#questions - Facebook Developers
     */
    String createQuestion(QuestionUpdate questionUpdate) throws FacebookException;

    /**
     * Creates the question.
     * @param id the ID of a page
     * @param questionUpdate the question to be created
     * @return The new question ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#questions - Facebook Developers
     */
    String createQuestion(String id, QuestionUpdate questionUpdate) throws FacebookException;

    /**
     * Returns a single question.
     * @param questionId the ID of the question
     * @return question
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Question - Facebook Developers
     */
    Question getQuestion(String questionId) throws FacebookException;

    /**
     * Returns a single question.
     * @param questionId the ID of the question
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return question
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Question - Facebook Developers
     */
    Question getQuestion(String questionId, Reading reading) throws FacebookException;
    

    /**
     * Deletes the question.
     * @param questionId the ID of the question
     * @return true if delete is successful
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#questions - Facebook Developers
     */
    boolean deleteQuestion(String questionId) throws FacebookException;


    /**
     * Returns the options available as answers to the question.
     * @param questionId the ID of the question
     * @return the options available as answers to the question
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Question#options - Facebook Developers
     */
    ResponseList getQuestionOptions(String questionId) throws FacebookException;

    /**
     * Returns the options available as answers to the question.
     * @param questionId the ID of the question
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return the options available as answers to the question
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Question#options - Facebook Developers
     */
    ResponseList getQuestionOptions(String questionId, Reading reading) throws FacebookException;

    /**
     * Adds the option to a question.
     * @param questionId the ID of the question
     * @param optionDescription description
     * @return option ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Question#options - Facebook Developers
     */
    String addQuestionOption(String questionId, String optionDescription) throws FacebookException;


    /**
     * Returns the votes a particular option to a question has received.
     * @param questionId the ID of the question
     * @return option of users who have voted for this specific option
     * @throws FacebookException when Facebook service or network is unavailable
     * @see QuestionOption - Facebook Developers
     */
    ResponseList getQuestionOptionVotes(String questionId) throws FacebookException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy