
cn.leancloud.service.APIService Maven / Gradle / Ivy
package cn.leancloud.service;
import cn.leancloud.*;
import cn.leancloud.query.AVQueryResult;
import cn.leancloud.sms.AVCaptchaDigest;
import cn.leancloud.sms.AVCaptchaValidateResult;
import cn.leancloud.types.AVDate;
import cn.leancloud.types.AVNull;
import cn.leancloud.upload.FileUploadToken;
import io.reactivex.Observable;
import retrofit2.Call;
import retrofit2.http.*;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.*;
public interface APIService {
/**
* Object Operations.
*/
@GET("/1.1/classes/{className}")
Observable> findObjects(@Path("className") String className);
@GET("/1.1/classes/{className}")
Observable queryObjects(@Path("className") String className, @QueryMap Map query);
@GET("/1.1/cloudQuery")
Observable cloudQuery(@QueryMap Map query);
@GET("/1.1/classes/{className}/{objectId}")
Observable fetchObject(@Path("className") String className, @Path("objectId") String objectId);
@GET("/1.1/classes/{className}/{objectId}")
Observable fetchObject(@Path("className") String className, @Path("objectId") String objectId,
@Query("include") String includeKeys);
@POST("/1.1/classes/{className}")
Observable createObject(@Path("className") String className, @Body JSONObject object,
@Query("fetchWhenSave") boolean fetchFlag,
@Query("where") JSONObject where);
@PUT("/1.1/classes/{className}/{objectId}")
Observable updateObject(@Path("className") String className, @Path("objectId") String objectId,
@Body JSONObject object, @Query("fetchWhenSave") boolean fetchFlag,
@Query("where") JSONObject where);
@DELETE("/1.1/classes/{className}/{objectId}")
Observable deleteObject(@Path("className") String className, @Path("objectId") String objectId);
@POST("/1.1/batch")
Observable batchCreate(@Body JSONObject param);
/**
* AVInstalltion methods.
*/
@POST("/1.1/{endpointClass}")
Observable saveWholeObject(@Path("endpointClass") String endpointClass, @Body JSONObject object,
@Query("fetchWhenSave") boolean fetchFlag,
@Query("where") JSONObject where);
@PUT("/1.1/{endpointClass}/{objectId}")
Observable saveWholeObject(@Path("endpointClass") String endpointClass, @Path("objectId") String objectId,
@Body JSONObject object, @Query("fetchWhenSave") boolean fetchFlag,
@Query("where") JSONObject where);
@GET("/1.1/{endpointClass}/{objectId}")
Observable getWholeObject(@Path("endpointClass") String endpointClass, @Path("objectId") String objectId);
@DELETE("/1.1/{endpointClass}/{objectId}")
Observable deleteWholeObject(@Path("endpointClass") String endpointClass, @Path("objectId") String objectId);
/**
* request format:
* requests: [unit, unit]
* unit format:
* {"path":"/1.1/classes/{class}/{objectId}",
* "method":"PUT",
* "body":{"{field}":operationJson,
* "__internalId":"{objectId}",
* "__children":[]},
* "params":{}
* }
* for update same field with multiple operations, we must use batchUpdate instead of batchSave,
* otherwise, `__internalId` will become a common field of target instance.
*/
@POST("/1.1/batch/save")
Observable batchUpdate(@Body JSONObject param);
/**
* Cloud Functions
*/
@POST("/1.1/functions/{name}")
Observable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy