/*
 * Copyright 2017 SgrAlpha
 *
 * 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 io.sgr.telegram.bot.api;

import java.util.List;

import io.sgr.telegram.bot.api.models.Chat;
import io.sgr.telegram.bot.api.models.ChatMember;
import io.sgr.telegram.bot.api.models.Message;
import io.sgr.telegram.bot.api.models.Update;
import io.sgr.telegram.bot.api.models.User;
import io.sgr.telegram.bot.api.models.game.GameHighScore;
import io.sgr.telegram.bot.api.models.game.http.GetGameScorePayload;
import io.sgr.telegram.bot.api.models.game.http.SendGamePayload;
import io.sgr.telegram.bot.api.models.game.http.SetGameScorePayload;
import io.sgr.telegram.bot.api.models.http.AnswerCallbackQueryPayload;
import io.sgr.telegram.bot.api.models.http.AnswerInlineQueryPayload;
import io.sgr.telegram.bot.api.models.http.ApiResponse;
import io.sgr.telegram.bot.api.models.http.EditMessageCaptionPayload;
import io.sgr.telegram.bot.api.models.http.EditMessageReplyMarkupPayload;
import io.sgr.telegram.bot.api.models.http.EditMessageTextPayload;
import io.sgr.telegram.bot.api.models.http.ForwardMessagePayload;
import io.sgr.telegram.bot.api.models.http.GetUpdatesPayload;
import io.sgr.telegram.bot.api.models.http.SendMessagePayload;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * @author SgrAlpha
 *
 */
public interface BotApi {

	@POST("/bot{apiToken}/getMe")
	Call<ApiResponse<User>> getMe(@Path("apiToken") String apiToken);

	@POST("/bot{apiToken}/getUpdates")
	Call<ApiResponse<List<Update>>> getUpdates(@Path("apiToken") String apiToken, @Body GetUpdatesPayload payload);

	@POST("/bot{apiToken}/sendMessage")
	Call<ApiResponse<Message>> sendMessage(@Path("apiToken") String apiToken, @Body SendMessagePayload payload);

	@POST("/bot{apiToken}/forwardMessage")
	Call<ApiResponse<Message>> forwardMessage(@Path("apiToken") String apiToken, @Body ForwardMessagePayload payload);

	@POST("/bot{apiToken}/editMessageText")
	Call<ApiResponse<Message>> editMessageText(@Path("apiToken") String apiToken, @Body EditMessageTextPayload payload);

	@POST("/bot{apiToken}/editMessageCaption")
	Call<ApiResponse<Message>> editMessageCaption(@Path("apiToken") String apiToken, @Body EditMessageCaptionPayload payload);

	@POST("/bot{apiToken}/editMessageReplyMarkup")
	Call<ApiResponse<Message>> editMessageReplyMarkup(@Path("apiToken") String apiToken, @Body EditMessageReplyMarkupPayload payload);

	@POST("/bot{apiToken}/answerInlineQuery")
	Call<ApiResponse<Boolean>> answerInlineQuery(@Path("apiToken") String apiToken, @Body AnswerInlineQueryPayload payload);

	@FormUrlEncoded
	@POST("/bot{apiToken}/kickChatMember")
	Call<ApiResponse<Boolean>> kickChatMember(@Path("apiToken") String apiToken, @Field("chat_id") String chatId, @Field("user_id") long userId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/kickChatMember")
	Call<ApiResponse<Boolean>> kickChatMember(@Path("apiToken") String apiToken, @Field("chat_id") long chatId, @Field("user_id") long userId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/unbanChatMember")
	Call<ApiResponse<Boolean>> unbanChatMember(@Path("apiToken") String apiToken, @Field("chat_id") String chatId, @Field("user_id") long userId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/unbanChatMember")
	Call<ApiResponse<Boolean>> unbanChatMember(@Path("apiToken") String apiToken, @Field("chat_id") long chatId, @Field("user_id") long userId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/restrictChatMember")
	Call<ApiResponse<Boolean>> restrictChatMember(@Path("apiToken") String apiToken, @Field("chat_id") String chatId, @Field("user_id") long userId, @Field("until_date") Long untilDate, @Field("can_send_messages") Boolean canSendMessage, @Field("can_send_media_messages") Boolean canSendMediaMessage, @Field("can_send_other_messages") Boolean canSendOtherMessage, @Field("can_add_web_page_previews") Boolean canAddWebPagePreviews);

	@FormUrlEncoded
	@POST("/bot{apiToken}/restrictChatMember")
	Call<ApiResponse<Boolean>> restrictChatMember(@Path("apiToken") String apiToken, @Field("chat_id") long chatId, @Field("user_id") long userId, @Field("until_date") Long untilDate, @Field("can_send_messages") Boolean canSendMessage, @Field("can_send_media_messages") Boolean canSendMediaMessage, @Field("can_send_other_messages") Boolean canSendOtherMessage, @Field("can_add_web_page_previews") Boolean canAddWebPagePreviews);

	@FormUrlEncoded
	@POST("/bot{apiToken}/promoteChatMember")
	Call<ApiResponse<Boolean>> promoteChatMember(@Path("apiToken") String apiToken, @Field("chat_id") String chatId, @Field("user_id") long userId, @Field("can_change_info") Boolean canChangeInfo, @Field("can_post_messages") Boolean canPostMessage, @Field("can_edit_messages") Boolean canEditMessage, @Field("can_delete_messages") Boolean canDeleteMessage, @Field("can_invite_users") Boolean canInviteUsers, @Field("can_restrict_members") Boolean canRestrictMembers, @Field("can_pin_messages") Boolean canPinMessage, @Field("can_promote_members") Boolean canPromoteMembers);

	@FormUrlEncoded
	@POST("/bot{apiToken}/promoteChatMember")
	Call<ApiResponse<Boolean>> promoteChatMember(@Path("apiToken") String apiToken, @Field("chat_id") long chatId, @Field("user_id") long userId, @Field("can_change_info") Boolean canChangeInfo, @Field("can_post_messages") Boolean canPostMessage, @Field("can_edit_messages") Boolean canEditMessage, @Field("can_delete_messages") Boolean canDeleteMessage, @Field("can_invite_users") Boolean canInviteUsers, @Field("can_restrict_members") Boolean canRestrictMembers, @Field("can_pin_messages") Boolean canPinMessage, @Field("can_promote_members") Boolean canPromoteMembers);

	@FormUrlEncoded
	@POST("/bot{apiToken}/exportChatInviteLink")
	Call<ApiResponse<String>> exportChatInviteLink(@Path("apiToken") String apiToken, @Field("chat_id") String chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/exportChatInviteLink")
	Call<ApiResponse<String>> exportChatInviteLink(@Path("apiToken") String apiToken, @Field("chat_id") long chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/deleteChatPhoto")
	Call<ApiResponse<Boolean>> deleteChatPhoto(@Path("apiToken") String apiToken, @Field("chat_id") String chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/deleteChatPhoto")
	Call<ApiResponse<Boolean>> deleteChatPhoto(@Path("apiToken") String apiToken, @Field("chat_id") long chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/setChatTitle")
	Call<ApiResponse<Boolean>> setChatTitle(@Path("apiToken") String apiToken, @Field("chat_id") String chatId, @Field("title") String title);

	@FormUrlEncoded
	@POST("/bot{apiToken}/setChatTitle")
	Call<ApiResponse<Boolean>> setChatTitle(@Path("apiToken") String apiToken, @Field("chat_id") long chatId, @Field("title") String title);

	@FormUrlEncoded
	@POST("/bot{apiToken}/setChatDescription")
	Call<ApiResponse<Boolean>> setChatDescription(@Path("apiToken") String apiToken, @Field("chat_id") String chatId, @Field("description") String description);

	@FormUrlEncoded
	@POST("/bot{apiToken}/setChatDescription")
	Call<ApiResponse<Boolean>> setChatDescription(@Path("apiToken") String apiToken, @Field("chat_id") long chatId, @Field("description") String description);

	@FormUrlEncoded
	@POST("/bot{apiToken}/pinChatMessage")
	Call<ApiResponse<Boolean>> pinChatMessage(@Path("apiToken") String apiToken, @Field("chat_id") String chatId, @Field("message_id") long messageId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/pinChatMessage")
	Call<ApiResponse<Boolean>> pinChatMessage(@Path("apiToken") String apiToken, @Field("chat_id") long chatId, @Field("message_id") long messageId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/unpinChatMessage")
	Call<ApiResponse<Boolean>> unpinChatMessage(@Path("apiToken") String apiToken, @Field("chat_id") String chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/unpinChatMessage")
	Call<ApiResponse<Boolean>> unpinChatMessage(@Path("apiToken") String apiToken, @Field("chat_id") long chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/leaveChat")
	Call<ApiResponse<Boolean>> leaveChat(@Path("apiToken") String apiToken, @Field("chat_id") String chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/leaveChat")
	Call<ApiResponse<Boolean>> leaveChat(@Path("apiToken") String apiToken, @Field("chat_id") long chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/getChat")
	Call<ApiResponse<Chat>> getChat(@Path("apiToken") String apiToken, @Field("chat_id") String chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/getChat")
	Call<ApiResponse<Chat>> getChat(@Path("apiToken") String apiToken, @Field("chat_id") long chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/getChatAdministrators")
	Call<ApiResponse<List<ChatMember>>> getChatAdministrators(@Path("apiToken") String apiToken, @Field("chat_id") String chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/getChatAdministrators")
	Call<ApiResponse<List<ChatMember>>> getChatAdministrators(@Path("apiToken") String apiToken, @Field("chat_id") long chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/getChatMembersCount")
	Call<ApiResponse<Integer>> getChatMembersCount(@Path("apiToken") String apiToken, @Field("chat_id") String chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/getChatMembersCount")
	Call<ApiResponse<Integer>> getChatMembersCount(@Path("apiToken") String apiToken, @Field("chat_id") long chatId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/getChatMember")
	Call<ApiResponse<ChatMember>> getChatMember(@Path("apiToken") String apiToken, @Field("chat_id") String chatId, @Field("user_id") long userId);

	@FormUrlEncoded
	@POST("/bot{apiToken}/getChatMember")
	Call<ApiResponse<ChatMember>> getChatMember(@Path("apiToken") String apiToken, @Field("chat_id") long chatId, @Field("user_id") long userId);

	@POST("/bot{apiToken}/answerCallbackQuery")
	Call<ApiResponse<Boolean>> answerCallbackQuery(@Path("apiToken") String apiToken, @Body AnswerCallbackQueryPayload payload);
	
	@POST("/bot{apiToken}/sendGame")
	Call<ApiResponse<Message>> sendGame(@Path("apiToken") String apiToken, @Body SendGamePayload payload);

	@POST("/bot{apiToken}/setGameScore")
	Call<ApiResponse<Message>> setGameScoreByBot(@Path("apiToken") String apiToken, @Body SetGameScorePayload payload);

	@POST("/bot{apiToken}/setGameScore")
	Call<ApiResponse<Boolean>> setGameScore(@Path("apiToken") String apiToken, @Body SetGameScorePayload payload);

	@POST("/bot{apiToken}/getGameHighScores")
	Call<ApiResponse<List<GameHighScore>>> getGameHighScores(@Path("apiToken") String apiToken, @Body GetGameScorePayload payload);
}