set default user default for ruby, php, python, java

This commit is contained in:
wing328
2016-03-14 22:26:11 +08:00
parent e10c28596c
commit be7a49385f
78 changed files with 2285 additions and 1953 deletions

View File

@@ -1,6 +1,6 @@
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:21.255+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:53.252+08:00")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).

View File

@@ -7,8 +7,8 @@ import retrofit.http.*;
import retrofit.mime.*;
import io.swagger.client.model.Pet;
import java.io.File;
import io.swagger.client.model.InlineResponse200;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
@@ -17,32 +17,6 @@ import java.util.Map;
public interface PetApi {
/**
* Update an existing pet
* Sync method
*
* @param body Pet object that needs to be added to the store
* @return Void
*/
@PUT("/pet")
Void updatePet(
@Body Pet body
);
/**
* Update an existing pet
* Async method
* @param body Pet object that needs to be added to the store
* @param cb callback method
* @return void
*/
@PUT("/pet")
void updatePet(
@Body Pet body, Callback<Void> cb
);
/**
* Add a new pet to the store
* Sync method
@@ -69,6 +43,60 @@ public interface PetApi {
@Body Pet body, Callback<Void> cb
);
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
* Sync method
*
* @param body Pet object in the form of byte array
* @return Void
*/
@POST("/pet?testing_byte_array=true")
Void addPetUsingByteArray(
@Body byte[] body
);
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
* Async method
* @param body Pet object in the form of byte array
* @param cb callback method
* @return void
*/
@POST("/pet?testing_byte_array=true")
void addPetUsingByteArray(
@Body byte[] body, Callback<Void> cb
);
/**
* Deletes a pet
* Sync method
*
* @param petId Pet id to delete
* @param apiKey
* @return Void
*/
@DELETE("/pet/{petId}")
Void deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey
);
/**
* Deletes a pet
* Async method
* @param petId Pet id to delete
* @param apiKey
* @param cb callback method
* @return void
*/
@DELETE("/pet/{petId}")
void deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey, Callback<Void> cb
);
/**
* Finds Pets by status
* Sync method
@@ -147,98 +175,6 @@ public interface PetApi {
@Path("petId") Long petId, Callback<Pet> cb
);
/**
* Updates a pet in the store with form data
* Sync method
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
* @return Void
*/
@FormUrlEncoded
@POST("/pet/{petId}")
Void updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status
);
/**
* Updates a pet in the store with form data
* Async method
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
* @param cb callback method
* @return void
*/
@FormUrlEncoded
@POST("/pet/{petId}")
void updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status, Callback<Void> cb
);
/**
* Deletes a pet
* Sync method
*
* @param petId Pet id to delete
* @param apiKey
* @return Void
*/
@DELETE("/pet/{petId}")
Void deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey
);
/**
* Deletes a pet
* Async method
* @param petId Pet id to delete
* @param apiKey
* @param cb callback method
* @return void
*/
@DELETE("/pet/{petId}")
void deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey, Callback<Void> cb
);
/**
* uploads an image
* Sync method
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @return Void
*/
@Multipart
@POST("/pet/{petId}/uploadImage")
Void uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file
);
/**
* uploads an image
* Async method
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @param cb callback method
* @return void
*/
@Multipart
@POST("/pet/{petId}/uploadImage")
void uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file, Callback<Void> cb
);
/**
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Sync method
@@ -292,29 +228,93 @@ public interface PetApi {
);
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
* Update an existing pet
* Sync method
*
* @param body Pet object in the form of byte array
* @param body Pet object that needs to be added to the store
* @return Void
*/
@POST("/pet?testing_byte_array=true")
Void addPetUsingByteArray(
@Body byte[] body
@PUT("/pet")
Void updatePet(
@Body Pet body
);
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
* Update an existing pet
* Async method
* @param body Pet object in the form of byte array
* @param body Pet object that needs to be added to the store
* @param cb callback method
* @return void
*/
@POST("/pet?testing_byte_array=true")
void addPetUsingByteArray(
@Body byte[] body, Callback<Void> cb
@PUT("/pet")
void updatePet(
@Body Pet body, Callback<Void> cb
);
/**
* Updates a pet in the store with form data
* Sync method
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
* @return Void
*/
@FormUrlEncoded
@POST("/pet/{petId}")
Void updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status
);
/**
* Updates a pet in the store with form data
* Async method
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
* @param cb callback method
* @return void
*/
@FormUrlEncoded
@POST("/pet/{petId}")
void updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status, Callback<Void> cb
);
/**
* uploads an image
* Sync method
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @return Void
*/
@Multipart
@POST("/pet/{petId}/uploadImage")
Void uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file
);
/**
* uploads an image
* Async method
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @param cb callback method
* @return void
*/
@Multipart
@POST("/pet/{petId}/uploadImage")
void uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file, Callback<Void> cb
);
}

View File

@@ -15,6 +15,32 @@ import java.util.Map;
public interface StoreApi {
/**
* Delete purchase order by ID
* Sync method
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return Void
*/
@DELETE("/store/order/{orderId}")
Void deleteOrder(
@Path("orderId") String orderId
);
/**
* Delete purchase order by ID
* Async method
* @param orderId ID of the order that needs to be deleted
* @param cb callback method
* @return void
*/
@DELETE("/store/order/{orderId}")
void deleteOrder(
@Path("orderId") String orderId, Callback<Void> cb
);
/**
* Finds orders by status
* Sync method
@@ -87,32 +113,6 @@ public interface StoreApi {
Callback<Object> cb
);
/**
* Place an order for a pet
* Sync method
*
* @param body order placed for purchasing the pet
* @return Order
*/
@POST("/store/order")
Order placeOrder(
@Body Order body
);
/**
* Place an order for a pet
* Async method
* @param body order placed for purchasing the pet
* @param cb callback method
* @return void
*/
@POST("/store/order")
void placeOrder(
@Body Order body, Callback<Order> cb
);
/**
* Find purchase order by ID
* Sync method
@@ -140,29 +140,29 @@ public interface StoreApi {
);
/**
* Delete purchase order by ID
* Place an order for a pet
* Sync method
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return Void
*
* @param body order placed for purchasing the pet
* @return Order
*/
@DELETE("/store/order/{orderId}")
Void deleteOrder(
@Path("orderId") String orderId
@POST("/store/order")
Order placeOrder(
@Body Order body
);
/**
* Delete purchase order by ID
* Place an order for a pet
* Async method
* @param orderId ID of the order that needs to be deleted
* @param body order placed for purchasing the pet
* @param cb callback method
* @return void
*/
@DELETE("/store/order/{orderId}")
void deleteOrder(
@Path("orderId") String orderId, Callback<Void> cb
@POST("/store/order")
void placeOrder(
@Body Order body, Callback<Order> cb
);
}

View File

@@ -93,6 +93,58 @@ public interface UserApi {
@Body List<User> body, Callback<Void> cb
);
/**
* Delete user
* Sync method
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return Void
*/
@DELETE("/user/{username}")
Void deleteUser(
@Path("username") String username
);
/**
* Delete user
* Async method
* @param username The name that needs to be deleted
* @param cb callback method
* @return void
*/
@DELETE("/user/{username}")
void deleteUser(
@Path("username") String username, Callback<Void> cb
);
/**
* Get user by user name
* Sync method
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
*/
@GET("/user/{username}")
User getUserByName(
@Path("username") String username
);
/**
* Get user by user name
* Async method
* @param username The name that needs to be fetched. Use user1 for testing.
* @param cb callback method
* @return void
*/
@GET("/user/{username}")
void getUserByName(
@Path("username") String username, Callback<User> cb
);
/**
* Logs user into the system
* Sync method
@@ -144,32 +196,6 @@ public interface UserApi {
Callback<Void> cb
);
/**
* Get user by user name
* Sync method
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
*/
@GET("/user/{username}")
User getUserByName(
@Path("username") String username
);
/**
* Get user by user name
* Async method
* @param username The name that needs to be fetched. Use user1 for testing.
* @param cb callback method
* @return void
*/
@GET("/user/{username}")
void getUserByName(
@Path("username") String username, Callback<User> cb
);
/**
* Updated user
* Sync method
@@ -198,30 +224,4 @@ public interface UserApi {
@Path("username") String username, @Body User body, Callback<Void> cb
);
/**
* Delete user
* Sync method
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return Void
*/
@DELETE("/user/{username}")
Void deleteUser(
@Path("username") String username
);
/**
* Delete user
* Async method
* @param username The name that needs to be deleted
* @param cb callback method
* @return void
*/
@DELETE("/user/{username}")
void deleteUser(
@Path("username") String username, Callback<Void> cb
);
}

View File

@@ -3,6 +3,9 @@ package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
@@ -12,8 +15,8 @@ import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class InlineResponse200 {
@SerializedName("name")
private String name = null;
@SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>();
@SerializedName("id")
private Long id = null;
@@ -22,15 +25,47 @@ public class InlineResponse200 {
private Object category = null;
public enum StatusEnum {
@SerializedName("available")
AVAILABLE("available"),
@SerializedName("pending")
PENDING("pending"),
@SerializedName("sold")
SOLD("sold");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return value;
}
}
@SerializedName("status")
private StatusEnum status = null;
@SerializedName("name")
private String name = null;
@SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
/**
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
public List<Tag> getTags() {
return tags;
}
public void setName(String name) {
this.name = name;
public void setTags(List<Tag> tags) {
this.tags = tags;
}
@@ -56,6 +91,40 @@ public class InlineResponse200 {
}
/**
* pet status in the store
**/
@ApiModelProperty(value = "pet status in the store")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
/**
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
**/
@ApiModelProperty(value = "")
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
@Override
public boolean equals(Object o) {
@@ -66,14 +135,17 @@ public class InlineResponse200 {
return false;
}
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(name, inlineResponse200.name) &&
return Objects.equals(tags, inlineResponse200.tags) &&
Objects.equals(id, inlineResponse200.id) &&
Objects.equals(category, inlineResponse200.category);
Objects.equals(category, inlineResponse200.category) &&
Objects.equals(status, inlineResponse200.status) &&
Objects.equals(name, inlineResponse200.name) &&
Objects.equals(photoUrls, inlineResponse200.photoUrls);
}
@Override
public int hashCode() {
return Objects.hash(name, id, category);
return Objects.hash(tags, id, category, status, name, photoUrls);
}
@Override
@@ -81,9 +153,12 @@ public class InlineResponse200 {
StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append("}");
return sb.toString();
}