This commit is contained in:
Tony Tam 2015-10-20 11:42:40 -07:00
parent 295af57c9a
commit 7f5cdba606
15 changed files with 140 additions and 194 deletions

View File

@ -1,89 +1,11 @@
group = 'io.swagger' apply plugin: 'java'
version = '1.0.0' apply plugin: 'maven'
buildscript { sourceCompatibility = JavaVersion.VERSION_1_7
repositories { targetCompatibility = JavaVersion.VERSION_1_7
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.2'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
}
}
repositories { repositories {
jcenter() mavenCentral()
}
if(hasProperty('target') && target == 'android') {
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 22
buildToolsVersion '22.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
// Rename the aar correctly
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
}
afterEvaluate {
android.libraryVariants.all { variant ->
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
} else {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
install {
repositories.mavenInstaller {
pom.artifactId = 'swagger-petstore-okhttp-gson'
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
} }
dependencies { dependencies {
@ -93,3 +15,17 @@ dependencies {
compile 'com.brsanthu:migbase64:2.2' compile 'com.brsanthu:migbase64:2.2'
testCompile 'junit:junit:4.8.1' testCompile 'junit:junit:4.8.1'
} }
group = 'io.swagger'
version = '1.0.0'
install {
repositories.mavenInstaller {
pom.artifactId = 'swagger-petstore-okhttp-gson'
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}

View File

@ -3,7 +3,7 @@ package io.swagger.client;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class ApiException extends Exception { public class ApiException extends Exception {
private int code = 0; private int code = 0;
private Map<String, List<String>> responseHeaders = null; private Map<String, List<String>> responseHeaders = null;

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class Configuration { public class Configuration {
private static ApiClient defaultApiClient = new ApiClient(); private static ApiClient defaultApiClient = new ApiClient();

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class Pair { public class Pair {
private String name = ""; private String name = "";
private String value = ""; private String value = "";

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class StringUtil { public class StringUtil {
/** /**
* Check if the given array contains the given value (with case-insensitive comparison). * Check if the given array contains the given value (with case-insensitive comparison).

View File

@ -6,15 +6,22 @@ import io.swagger.client.ApiException;
import io.swagger.client.Configuration; import io.swagger.client.Configuration;
import io.swagger.client.Pair; import io.swagger.client.Pair;
import io.swagger.client.model.*;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call; import com.squareup.okhttp.Call;
import java.lang.reflect.Type;
import java.util.*;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import java.io.File; import java.io.File;
import java.lang.reflect.Type; import java.io.File;
import java.util.*; import java.util.Map;
import java.util.HashMap;
public class PetApi { public class PetApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -290,11 +297,7 @@ public class PetApi {
final String contentType = apiClient.selectHeaderContentType(contentTypes); final String contentType = apiClient.selectHeaderContentType(contentTypes);
headerParams.put("Content-Type", contentType); headerParams.put("Content-Type", contentType);
<<<<<<< HEAD
String[] authNames = new String[] { "api_key", "petstore_auth" }; String[] authNames = new String[] { "api_key", "petstore_auth" };
=======
String[] authNames = new String[] { "api_key" };
>>>>>>> master
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames); return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames);
} }

View File

@ -6,15 +6,22 @@ import io.swagger.client.ApiException;
import io.swagger.client.Configuration; import io.swagger.client.Configuration;
import io.swagger.client.Pair; import io.swagger.client.Pair;
import io.swagger.client.model.*;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call; import com.squareup.okhttp.Call;
import java.lang.reflect.Type;
import java.util.*;
import java.util.Map; import java.util.Map;
import io.swagger.client.model.Order; import io.swagger.client.model.Order;
import java.lang.reflect.Type; import java.io.File;
import java.util.*; import java.util.Map;
import java.util.HashMap;
public class StoreApi { public class StoreApi {
private ApiClient apiClient; private ApiClient apiClient;

View File

@ -6,15 +6,22 @@ import io.swagger.client.ApiException;
import io.swagger.client.Configuration; import io.swagger.client.Configuration;
import io.swagger.client.Pair; import io.swagger.client.Pair;
import io.swagger.client.model.*;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call; import com.squareup.okhttp.Call;
import java.lang.reflect.Type;
import java.util.*;
import io.swagger.client.model.User; import io.swagger.client.model.User;
import java.util.*; import java.util.*;
import java.lang.reflect.Type; import java.io.File;
import java.util.*; import java.util.Map;
import java.util.HashMap;
public class UserApi { public class UserApi {
private ApiClient apiClient; private ApiClient apiClient;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class ApiKeyAuth implements Authentication { public class ApiKeyAuth implements Authentication {
private final String location; private final String location;
private final String paramName; private final String paramName;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public interface Authentication { public interface Authentication {
/** Apply authentication settings to header and query params. */ /** Apply authentication settings to header and query params. */
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams); void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class OAuth implements Authentication { public class OAuth implements Authentication {
@Override @Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) { public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {

View File

@ -1,10 +1,6 @@
package io.swagger.client; package io.swagger.client;
<<<<<<< HEAD @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:31.307-07:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:22.261-07:00")
=======
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-11T00:10:38.251+02:00")
>>>>>>> master
public class StringUtil { public class StringUtil {
/** /**
* Check if the given array contains the given value (with case-insensitive comparison). * Check if the given array contains the given value (with case-insensitive comparison).

View File

@ -1,16 +1,15 @@
package io.swagger.client.api; package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*; import io.swagger.client.model.*;
import retrofit.Callback; import retrofit.Callback;
import retrofit.http.*; import retrofit.http.*;
import retrofit.mime.*; import retrofit.mime.*;
import java.util.*;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import java.io.File; import java.io.File;
import java.util.*;
public interface PetApi { public interface PetApi {
/** /**
@ -21,7 +20,7 @@ public interface PetApi {
* @return Void * @return Void
*/ */
@PUT("/pet") @PUT("/pet")
Void updatePet( Void updatePet(
@Body Pet body @Body Pet body
); );
@ -30,14 +29,14 @@ public interface PetApi {
* Update an existing pet * Update an existing pet
* Async method * Async method
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@PUT("/pet") @PUT("/pet")
void updatePet( void updatePet(
@Body Pet body, Callback<Void> cb @Body Pet body, Callback<Void> cb
); );
/** /**
* Add a new pet to the store * Add a new pet to the store
@ -47,7 +46,7 @@ public interface PetApi {
* @return Void * @return Void
*/ */
@POST("/pet") @POST("/pet")
Void addPet( Void addPet(
@Body Pet body @Body Pet body
); );
@ -56,14 +55,14 @@ public interface PetApi {
* Add a new pet to the store * Add a new pet to the store
* Async method * Async method
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@POST("/pet") @POST("/pet")
void addPet( void addPet(
@Body Pet body, Callback<Void> cb @Body Pet body, Callback<Void> cb
); );
/** /**
* Finds Pets by status * Finds Pets by status
@ -73,7 +72,7 @@ public interface PetApi {
* @return List<Pet> * @return List<Pet>
*/ */
@GET("/pet/findByStatus") @GET("/pet/findByStatus")
List<Pet> findPetsByStatus( List<Pet> findPetsByStatus(
@Query("status") List<String> status @Query("status") List<String> status
); );
@ -82,14 +81,14 @@ public interface PetApi {
* Finds Pets by status * Finds Pets by status
* Async method * Async method
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@GET("/pet/findByStatus") @GET("/pet/findByStatus")
void findPetsByStatus( void findPetsByStatus(
@Query("status") List<String> status, Callback<List<Pet>> cb @Query("status") List<String> status, Callback<List<Pet>> cb
); );
/** /**
* Finds Pets by tags * Finds Pets by tags
@ -99,7 +98,7 @@ public interface PetApi {
* @return List<Pet> * @return List<Pet>
*/ */
@GET("/pet/findByTags") @GET("/pet/findByTags")
List<Pet> findPetsByTags( List<Pet> findPetsByTags(
@Query("tags") List<String> tags @Query("tags") List<String> tags
); );
@ -108,14 +107,14 @@ public interface PetApi {
* Finds Pets by tags * Finds Pets by tags
* Async method * Async method
* @param tags Tags to filter by * @param tags Tags to filter by
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@GET("/pet/findByTags") @GET("/pet/findByTags")
void findPetsByTags( void findPetsByTags(
@Query("tags") List<String> tags, Callback<List<Pet>> cb @Query("tags") List<String> tags, Callback<List<Pet>> cb
); );
/** /**
* Find pet by ID * Find pet by ID
@ -125,7 +124,7 @@ public interface PetApi {
* @return Pet * @return Pet
*/ */
@GET("/pet/{petId}") @GET("/pet/{petId}")
Pet getPetById( Pet getPetById(
@Path("petId") Long petId @Path("petId") Long petId
); );
@ -134,14 +133,14 @@ public interface PetApi {
* Find pet by ID * Find pet by ID
* Async method * Async method
* @param petId ID of pet that needs to be fetched * @param petId ID of pet that needs to be fetched
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@GET("/pet/{petId}") @GET("/pet/{petId}")
void getPetById( void getPetById(
@Path("petId") Long petId, Callback<Pet> cb @Path("petId") Long petId, Callback<Pet> cb
); );
/** /**
* Updates a pet in the store with form data * Updates a pet in the store with form data
@ -154,7 +153,7 @@ public interface PetApi {
*/ */
@FormUrlEncoded @FormUrlEncoded
@POST("/pet/{petId}") @POST("/pet/{petId}")
Void updatePetWithForm( Void updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status @Path("petId") String petId, @Field("name") String name, @Field("status") String status
); );
@ -165,15 +164,15 @@ public interface PetApi {
* @param petId ID of pet that needs to be updated * @param petId ID of pet that needs to be updated
* @param name Updated name of the pet * @param name Updated name of the pet
* @param status Updated status of the pet * @param status Updated status of the pet
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@FormUrlEncoded @FormUrlEncoded
@POST("/pet/{petId}") @POST("/pet/{petId}")
void updatePetWithForm( void updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status, Callback<Void> cb @Path("petId") String petId, @Field("name") String name, @Field("status") String status, Callback<Void> cb
); );
/** /**
* Deletes a pet * Deletes a pet
@ -184,7 +183,7 @@ public interface PetApi {
* @return Void * @return Void
*/ */
@DELETE("/pet/{petId}") @DELETE("/pet/{petId}")
Void deletePet( Void deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey @Path("petId") Long petId, @Header("api_key") String apiKey
); );
@ -194,14 +193,14 @@ public interface PetApi {
* Async method * Async method
* @param petId Pet id to delete * @param petId Pet id to delete
* @param apiKey * @param apiKey
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@DELETE("/pet/{petId}") @DELETE("/pet/{petId}")
void deletePet( void deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey, Callback<Void> cb @Path("petId") Long petId, @Header("api_key") String apiKey, Callback<Void> cb
); );
/** /**
* uploads an image * uploads an image
@ -214,7 +213,7 @@ public interface PetApi {
*/ */
@Multipart @Multipart
@POST("/pet/{petId}/uploadImage") @POST("/pet/{petId}/uploadImage")
Void uploadFile( Void uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file
); );
@ -225,14 +224,14 @@ public interface PetApi {
* @param petId ID of pet to update * @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server * @param additionalMetadata Additional data to pass to server
* @param file file to upload * @param file file to upload
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@Multipart @Multipart
@POST("/pet/{petId}/uploadImage") @POST("/pet/{petId}/uploadImage")
void uploadFile( void uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file, Callback<Void> cb @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file, Callback<Void> cb
); );
} }

View File

@ -1,16 +1,15 @@
package io.swagger.client.api; package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*; import io.swagger.client.model.*;
import retrofit.Callback; import retrofit.Callback;
import retrofit.http.*; import retrofit.http.*;
import retrofit.mime.*; import retrofit.mime.*;
import java.util.*;
import java.util.Map; import java.util.Map;
import io.swagger.client.model.Order; import io.swagger.client.model.Order;
import java.util.*;
public interface StoreApi { public interface StoreApi {
/** /**
@ -20,21 +19,21 @@ public interface StoreApi {
* @return Map<String, Integer> * @return Map<String, Integer>
*/ */
@GET("/store/inventory") @GET("/store/inventory")
Map<String, Integer> getInventory(); Map<String, Integer> getInventory();
/** /**
* Returns pet inventories by status * Returns pet inventories by status
* Async method * Async method
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@GET("/store/inventory") @GET("/store/inventory")
void getInventory( void getInventory(
Callback<Map<String, Integer>> cb Callback<Map<String, Integer>> cb
); );
/** /**
* Place an order for a pet * Place an order for a pet
@ -44,7 +43,7 @@ public interface StoreApi {
* @return Order * @return Order
*/ */
@POST("/store/order") @POST("/store/order")
Order placeOrder( Order placeOrder(
@Body Order body @Body Order body
); );
@ -53,14 +52,14 @@ public interface StoreApi {
* Place an order for a pet * Place an order for a pet
* Async method * Async method
* @param body order placed for purchasing the pet * @param body order placed for purchasing the pet
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@POST("/store/order") @POST("/store/order")
void placeOrder( void placeOrder(
@Body Order body, Callback<Order> cb @Body Order body, Callback<Order> cb
); );
/** /**
* Find purchase order by ID * Find purchase order by ID
@ -70,7 +69,7 @@ public interface StoreApi {
* @return Order * @return Order
*/ */
@GET("/store/order/{orderId}") @GET("/store/order/{orderId}")
Order getOrderById( Order getOrderById(
@Path("orderId") String orderId @Path("orderId") String orderId
); );
@ -79,14 +78,14 @@ public interface StoreApi {
* Find purchase order by ID * Find purchase order by ID
* Async method * Async method
* @param orderId ID of pet that needs to be fetched * @param orderId ID of pet that needs to be fetched
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@GET("/store/order/{orderId}") @GET("/store/order/{orderId}")
void getOrderById( void getOrderById(
@Path("orderId") String orderId, Callback<Order> cb @Path("orderId") String orderId, Callback<Order> cb
); );
/** /**
* Delete purchase order by ID * Delete purchase order by ID
@ -96,7 +95,7 @@ public interface StoreApi {
* @return Void * @return Void
*/ */
@DELETE("/store/order/{orderId}") @DELETE("/store/order/{orderId}")
Void deleteOrder( Void deleteOrder(
@Path("orderId") String orderId @Path("orderId") String orderId
); );
@ -105,13 +104,13 @@ public interface StoreApi {
* Delete purchase order by ID * Delete purchase order by ID
* Async method * Async method
* @param orderId ID of the order that needs to be deleted * @param orderId ID of the order that needs to be deleted
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@DELETE("/store/order/{orderId}") @DELETE("/store/order/{orderId}")
void deleteOrder( void deleteOrder(
@Path("orderId") String orderId, Callback<Void> cb @Path("orderId") String orderId, Callback<Void> cb
); );
} }

View File

@ -1,14 +1,13 @@
package io.swagger.client.api; package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*; import io.swagger.client.model.*;
import retrofit.Callback; import retrofit.Callback;
import retrofit.http.*; import retrofit.http.*;
import retrofit.mime.*; import retrofit.mime.*;
import io.swagger.client.model.User;
import java.util.*; import java.util.*;
import io.swagger.client.model.User;
import java.util.*; import java.util.*;
public interface UserApi { public interface UserApi {
@ -21,7 +20,7 @@ public interface UserApi {
* @return Void * @return Void
*/ */
@POST("/user") @POST("/user")
Void createUser( Void createUser(
@Body User body @Body User body
); );
@ -30,14 +29,14 @@ public interface UserApi {
* Create user * Create user
* Async method * Async method
* @param body Created user object * @param body Created user object
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@POST("/user") @POST("/user")
void createUser( void createUser(
@Body User body, Callback<Void> cb @Body User body, Callback<Void> cb
); );
/** /**
* Creates list of users with given input array * Creates list of users with given input array
@ -47,7 +46,7 @@ public interface UserApi {
* @return Void * @return Void
*/ */
@POST("/user/createWithArray") @POST("/user/createWithArray")
Void createUsersWithArrayInput( Void createUsersWithArrayInput(
@Body List<User> body @Body List<User> body
); );
@ -56,14 +55,14 @@ public interface UserApi {
* Creates list of users with given input array * Creates list of users with given input array
* Async method * Async method
* @param body List of user object * @param body List of user object
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@POST("/user/createWithArray") @POST("/user/createWithArray")
void createUsersWithArrayInput( void createUsersWithArrayInput(
@Body List<User> body, Callback<Void> cb @Body List<User> body, Callback<Void> cb
); );
/** /**
* Creates list of users with given input array * Creates list of users with given input array
@ -73,7 +72,7 @@ public interface UserApi {
* @return Void * @return Void
*/ */
@POST("/user/createWithList") @POST("/user/createWithList")
Void createUsersWithListInput( Void createUsersWithListInput(
@Body List<User> body @Body List<User> body
); );
@ -82,14 +81,14 @@ public interface UserApi {
* Creates list of users with given input array * Creates list of users with given input array
* Async method * Async method
* @param body List of user object * @param body List of user object
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@POST("/user/createWithList") @POST("/user/createWithList")
void createUsersWithListInput( void createUsersWithListInput(
@Body List<User> body, Callback<Void> cb @Body List<User> body, Callback<Void> cb
); );
/** /**
* Logs user into the system * Logs user into the system
@ -100,7 +99,7 @@ public interface UserApi {
* @return String * @return String
*/ */
@GET("/user/login") @GET("/user/login")
String loginUser( String loginUser(
@Query("username") String username, @Query("password") String password @Query("username") String username, @Query("password") String password
); );
@ -110,14 +109,14 @@ public interface UserApi {
* Async method * Async method
* @param username The user name for login * @param username The user name for login
* @param password The password for login in clear text * @param password The password for login in clear text
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@GET("/user/login") @GET("/user/login")
void loginUser( void loginUser(
@Query("username") String username, @Query("password") String password, Callback<String> cb @Query("username") String username, @Query("password") String password, Callback<String> cb
); );
/** /**
* Logs out current logged in user session * Logs out current logged in user session
@ -126,21 +125,21 @@ public interface UserApi {
* @return Void * @return Void
*/ */
@GET("/user/logout") @GET("/user/logout")
Void logoutUser(); Void logoutUser();
/** /**
* Logs out current logged in user session * Logs out current logged in user session
* Async method * Async method
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@GET("/user/logout") @GET("/user/logout")
void logoutUser( void logoutUser(
Callback<Void> cb Callback<Void> cb
); );
/** /**
* Get user by user name * Get user by user name
@ -150,7 +149,7 @@ public interface UserApi {
* @return User * @return User
*/ */
@GET("/user/{username}") @GET("/user/{username}")
User getUserByName( User getUserByName(
@Path("username") String username @Path("username") String username
); );
@ -159,14 +158,14 @@ public interface UserApi {
* Get user by user name * Get user by user name
* Async method * Async method
* @param username The name that needs to be fetched. Use user1 for testing. * @param username The name that needs to be fetched. Use user1 for testing.
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@GET("/user/{username}") @GET("/user/{username}")
void getUserByName( void getUserByName(
@Path("username") String username, Callback<User> cb @Path("username") String username, Callback<User> cb
); );
/** /**
* Updated user * Updated user
@ -177,7 +176,7 @@ public interface UserApi {
* @return Void * @return Void
*/ */
@PUT("/user/{username}") @PUT("/user/{username}")
Void updateUser( Void updateUser(
@Path("username") String username, @Body User body @Path("username") String username, @Body User body
); );
@ -187,14 +186,14 @@ public interface UserApi {
* Async method * Async method
* @param username name that need to be deleted * @param username name that need to be deleted
* @param body Updated user object * @param body Updated user object
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@PUT("/user/{username}") @PUT("/user/{username}")
void updateUser( void updateUser(
@Path("username") String username, @Body User body, Callback<Void> cb @Path("username") String username, @Body User body, Callback<Void> cb
); );
/** /**
* Delete user * Delete user
@ -204,7 +203,7 @@ public interface UserApi {
* @return Void * @return Void
*/ */
@DELETE("/user/{username}") @DELETE("/user/{username}")
Void deleteUser( Void deleteUser(
@Path("username") String username @Path("username") String username
); );
@ -213,13 +212,13 @@ public interface UserApi {
* Delete user * Delete user
* Async method * Async method
* @param username The name that needs to be deleted * @param username The name that needs to be deleted
* @param cb callback method * @param cb callback method
* @return void * @return void
*/ */
@DELETE("/user/{username}") @DELETE("/user/{username}")
void deleteUser( void deleteUser(
@Path("username") String username, Callback<Void> cb @Path("username") String username, Callback<Void> cb
); );
} }