Skip to content

Instantly share code, notes, and snippets.

@MaxMyalkin
Last active September 1, 2017 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaxMyalkin/ab786a7f6b37fbe55f9c66c389e662eb to your computer and use it in GitHub Desktop.
Save MaxMyalkin/ab786a7f6b37fbe55f9c66c389e662eb to your computer and use it in GitHub Desktop.
@POST("file.upload/")
@Multipart
fun uploadMedia(@Part file: MultipartBody.Part): Observable<FileModel>
@GET("message.get/")
fun getMessages(@Query("chat_id") chatId: Int,
@Query("limit") limit: Int,
@Query("from") from: Int?,
@Query("direction") direction: Int): Observable<MessageWrapper>
@GET("message.get/")
fun getLastMessages(@Query("chat_id") chatId: Int,
@Query("limit") limit: Int,
@Query("direction") direction: Int = PaginatorDirection.BEFORE.intValue): Observable<MessageWrapper>
@FormUrlEncoded
@POST("message.send/")
fun sendMessage(@Field("text") text: String,
@Field("type") type: String,
@Field("room") room: Int): Observable<MessageModel>
@GET("message.get_question/")
fun getQuestions(@Query("limit") limit: Int,
@Query("from") from: Int?,
@Query("direction") direction: Int): Observable<MessageWrapper>
@GET("message.get_question/")
fun getLastQuestions(
@Query("limit") limit: Int,
@Query("direction") direction: Int = PaginatorDirection.BEFORE.intValue): Observable<MessageWrapper>
@GET("team.get/")
fun getCurrentUserTeams(): Observable<List<TeamModel>>
@POST("team.toggle_notification/")
@FormUrlEncoded
fun toggleNotification(@Field("is_muted") isMuted: Boolean,
@Field("team_id") teamId: Int): Observable<IsMutedData>
@GET("company.members/")
fun getUsersFromCompany(): Observable<List<UserModel>>
@POST("team.leave/")
@FormUrlEncoded
fun leaveFromTeam(@Field("teamId") teamId: Int): Observable<Unit>
@POST("team.invite/")
@FormUrlEncoded
fun inviteUsersToTeam(@Field("teamId") teamId: Int, @Field("userId") users: String): Observable<Unit>
@GET("team.get_by_id/")
fun getTeam(@Query("id") id: Int): Observable<TeamModel>
@POST("team.create/")
@FormUrlEncoded
fun createTeam(@Field("avatar") avatarId: String,
@Field("name") name: String,
@Field("description") descriptor: String,
@Field("purpose") purpose: String,
@Field("rules") rules: String,
@Field("users") users: String): Observable<TeamModel>
@GET("user.get/")
fun getCurrentUser(): Observable<UserModel>
@GET("auth.login/")
fun login(): Observable<TokenModel>
@FormUrlEncoded
@POST("auth.send_token/")
fun registerPushToken(@Field("token") token: String,
@Field("device_platform") platform: String = "android"): Observable<Unit>
@POST("auth.logout/")
fun logout(): Observable<Unit>
@FormUrlEncoded
@POST("auth.restore/")
fun restorePassword(@Field("email") email: String): Observable<Unit>
@GET("chat.get/")
fun getChat(@Query("id") id: Int): Observable<ChatModel>
@GET("chat.list/")
fun getListWithChatId(@Query("chatId") ids: String,
@Query("withoutUsers") withoutUsers: Boolean = false,
@Query("withoutLastMsg") withoutLastMsg: Boolean = false): Single<List<ChatModel>>
@GET("chat.list/")
fun getListWithTeams(@Query("team") team: Int,
@Query("withoutUsers") withoutUsers: Boolean = false,
@Query("withoutLastMsg") withoutLastMsg: Boolean = false): Single<List<ChatModel>>
@POST("invite.create/")
fun getInviteLink(@Body body: InviteBody): Observable<InviteModel>
@GET("invite.get_info/")
fun getInviteInfo(@Query("token") token: String): Observable<InviteCheckModel>
@POST("invite.activate/")
fun activateInvite(@Body body: InviteActivateBody): Observable<TokenModel>
class InviteBody(val email: String, val teams: String)
class InviteActivateBody(val token: String, val firstName: String, val password: String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment