Merge pull request #2414 from xhh/java-default-value

Include parameter's default value in comment for operations
This commit is contained in:
wing328 2016-03-19 17:44:21 +08:00
commit 91f963b92d
58 changed files with 1913 additions and 406 deletions

View File

@ -20,7 +20,7 @@ public interface {{classname}} extends ApiClient.Api {
/**
* {{summary}}
* {{notes}}
{{#allParams}} * @param {{paramName}} {{description}}
{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/
@RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}")

View File

@ -23,7 +23,7 @@ public interface {{classname}} {
* {{summary}}
* Sync method
* {{notes}}
{{#allParams}} * @param {{paramName}} {{description}}
{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/
{{#formParams}}{{#-first}}
@ -36,7 +36,7 @@ public interface {{classname}} {
/**
* {{summary}}
* Async method
{{#allParams}} * @param {{paramName}} {{description}}
{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @param cb callback method
* @return void
*/

View File

@ -24,7 +24,7 @@ public interface {{classname}} {
/**
* {{summary}}
* {{notes}}
{{#allParams}} * @param {{paramName}} {{description}}
{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @return Call<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>
*/
{{#formParams}}{{#-first}}

View File

@ -0,0 +1,12 @@
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -6,20 +6,23 @@ import io.swagger.client.model.Pet;
import io.swagger.client.model.InlineResponse200;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00")
public interface PetApi extends ApiClient.Api {
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store (optional)
* @return void
*/
@RequestLine("POST /pet")
@ -32,7 +35,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
*
* @param body Pet object in the form of byte array
* @param body Pet object in the form of byte array (optional)
* @return void
*/
@RequestLine("POST /pet?testing_byte_array=true")
@ -45,8 +48,8 @@ public interface PetApi extends ApiClient.Api {
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return void
*/
@RequestLine("DELETE /pet/{petId}")
@ -60,7 +63,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for query
* @param status Status values that need to be considered for query (optional, default to available)
* @return List<Pet>
*/
@RequestLine("GET /pet/findByStatus?status={status}")
@ -73,7 +76,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Finds Pets by tags
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @param tags Tags to filter by (optional)
* @return List<Pet>
*/
@RequestLine("GET /pet/findByTags?tags={tags}")
@ -86,7 +89,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Find pet by ID
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return Pet
*/
@RequestLine("GET /pet/{petId}")
@ -99,7 +102,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return InlineResponse200
*/
@RequestLine("GET /pet/{petId}?response=inline_arbitrary_object")
@ -112,7 +115,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return byte[]
*/
@RequestLine("GET /pet/{petId}?testing_byte_array=true")
@ -125,7 +128,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store (optional)
* @return void
*/
@RequestLine("PUT /pet")
@ -138,9 +141,9 @@ public interface PetApi extends ApiClient.Api {
/**
* Updates a pet in the store with form data
*
* @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 petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return void
*/
@RequestLine("POST /pet/{petId}")
@ -153,9 +156,9 @@ public interface PetApi extends ApiClient.Api {
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return void
*/
@RequestLine("POST /pet/{petId}/uploadImage")
@ -165,4 +168,5 @@ public interface PetApi extends ApiClient.Api {
})
void uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file);
}

View File

@ -4,20 +4,23 @@ import io.swagger.client.ApiClient;
import io.swagger.client.model.Order;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00")
public interface StoreApi extends ApiClient.Api {
/**
* Delete purchase order by ID
* 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
* @param orderId ID of the order that needs to be deleted (required)
* @return void
*/
@RequestLine("DELETE /store/order/{orderId}")
@ -30,7 +33,7 @@ public interface StoreApi extends ApiClient.Api {
/**
* Finds orders by status
* A single status value can be provided as a string
* @param status Status value that needs to be considered for query
* @param status Status value that needs to be considered for query (optional, default to placed)
* @return List<Order>
*/
@RequestLine("GET /store/findByStatus?status={status}")
@ -67,7 +70,7 @@ public interface StoreApi extends ApiClient.Api {
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @param orderId ID of pet that needs to be fetched (required)
* @return Order
*/
@RequestLine("GET /store/order/{orderId}")
@ -80,7 +83,7 @@ public interface StoreApi extends ApiClient.Api {
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @param body order placed for purchasing the pet (optional)
* @return Order
*/
@RequestLine("POST /store/order")
@ -90,4 +93,5 @@ public interface StoreApi extends ApiClient.Api {
})
Order placeOrder(Order body);
}

View File

@ -4,20 +4,23 @@ import io.swagger.client.ApiClient;
import io.swagger.client.model.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00")
public interface UserApi extends ApiClient.Api {
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @param body Created user object (optional)
* @return void
*/
@RequestLine("POST /user")
@ -30,7 +33,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Creates list of users with given input array
*
* @param body List of user object
* @param body List of user object (optional)
* @return void
*/
@RequestLine("POST /user/createWithArray")
@ -43,7 +46,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Creates list of users with given input array
*
* @param body List of user object
* @param body List of user object (optional)
* @return void
*/
@RequestLine("POST /user/createWithList")
@ -56,7 +59,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @param username The name that needs to be deleted (required)
* @return void
*/
@RequestLine("DELETE /user/{username}")
@ -69,7 +72,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Get user by user name
*
* @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. (required)
* @return User
*/
@RequestLine("GET /user/{username}")
@ -82,8 +85,8 @@ public interface UserApi extends ApiClient.Api {
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @param username The user name for login (optional)
* @param password The password for login in clear text (optional)
* @return String
*/
@RequestLine("GET /user/login?username={username}&password={password}")
@ -108,8 +111,8 @@ public interface UserApi extends ApiClient.Api {
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @param username name that need to be deleted (required)
* @param body Updated user object (optional)
* @return void
*/
@RequestLine("PUT /user/{username}")
@ -119,4 +122,5 @@ public interface UserApi extends ApiClient.Api {
})
void updateUser(@Param("username") String username, User body);
}

View File

@ -13,12 +13,16 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00")
public class InlineResponse200 {
private List<Tag> tags = new ArrayList<Tag>();
private List<String> photoUrls = new ArrayList<String>();
private String name = null;
private Long id = null;
private Object category = null;
private List<Tag> tags = new ArrayList<Tag>();
public enum StatusEnum {
@ -40,24 +44,39 @@ public class InlineResponse200 {
}
private StatusEnum status = null;
private String name = null;
private List<String> photoUrls = new ArrayList<String>();
/**
**/
public InlineResponse200 tags(List<Tag> tags) {
this.tags = tags;
public InlineResponse200 photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("tags")
public List<Tag> getTags() {
return tags;
@JsonProperty("photoUrls")
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
/**
**/
public InlineResponse200 name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(example = "doggie", value = "")
@JsonProperty("name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ -95,6 +114,23 @@ public class InlineResponse200 {
}
/**
**/
public InlineResponse200 tags(List<Tag> tags) {
this.tags = tags;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("tags")
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
/**
* pet status in the store
**/
@ -113,40 +149,6 @@ public class InlineResponse200 {
}
/**
**/
public InlineResponse200 name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(example = "doggie", value = "")
@JsonProperty("name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
**/
public InlineResponse200 photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("photoUrls")
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
@Override
public boolean equals(java.lang.Object o) {
@ -157,17 +159,17 @@ public class InlineResponse200 {
return false;
}
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(this.tags, inlineResponse200.tags) &&
return Objects.equals(this.photoUrls, inlineResponse200.photoUrls) &&
Objects.equals(this.name, inlineResponse200.name) &&
Objects.equals(this.id, inlineResponse200.id) &&
Objects.equals(this.category, inlineResponse200.category) &&
Objects.equals(this.status, inlineResponse200.status) &&
Objects.equals(this.name, inlineResponse200.name) &&
Objects.equals(this.photoUrls, inlineResponse200.photoUrls);
Objects.equals(this.tags, inlineResponse200.tags) &&
Objects.equals(this.status, inlineResponse200.status);
}
@Override
public int hashCode() {
return Objects.hash(tags, id, category, status, name, photoUrls);
return Objects.hash(photoUrls, name, id, category, tags, status);
}
@Override
@ -175,12 +177,12 @@ public class InlineResponse200 {
StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).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();
}
@ -197,3 +199,5 @@ public class InlineResponse200 {
}
}

View File

@ -0,0 +1,78 @@
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00")
public class Model200Response {
private Integer name = null;
/**
**/
public Model200Response name(Integer name) {
this.name = name;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Model200Response _200Response = (Model200Response) o;
return Objects.equals(this.name, _200Response.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model200Response {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,78 @@
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00")
public class ModelReturn {
private Integer _return = null;
/**
**/
public ModelReturn _return(Integer _return) {
this._return = _return;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("return")
public Integer getReturn() {
return _return;
}
public void setReturn(Integer _return) {
this._return = _return;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(this._return, _return._return);
}
@Override
public int hashCode() {
return Objects.hash(_return);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelReturn {\n");
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,98 @@
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00")
public class Name {
private Integer name = null;
private Integer snakeCase = null;
/**
**/
public Name name(Integer name) {
this.name = name;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
/**
**/
public Name snakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("snake_case")
public Integer getSnakeCase() {
return snakeCase;
}
public void setSnakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Name name = (Name) o;
return Objects.equals(this.name, name.name) &&
Objects.equals(this.snakeCase, name.snakeCase);
}
@Override
public int hashCode() {
return Objects.hash(name, snakeCase);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Name {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,78 @@
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00")
public class SpecialModelName {
private Long specialPropertyName = null;
/**
**/
public SpecialModelName specialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("$special[property.name]")
public Long getSpecialPropertyName() {
return specialPropertyName;
}
public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName);
}
@Override
public int hashCode() {
return Objects.hash(specialPropertyName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SpecialModelName {\n");
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,12 @@
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -10,18 +10,22 @@ import io.swagger.client.model.Pet;
import io.swagger.client.model.InlineResponse200;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface PetApi {
/**
* Add a new pet to the store
* Sync 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 (optional)
* @return Void
*/
@ -33,7 +37,7 @@ public interface PetApi {
/**
* Add a new pet to the store
* 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 (optional)
* @param cb callback method
* @return void
*/
@ -47,7 +51,7 @@ public interface PetApi {
* 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
* @param body Pet object in the form of byte array (optional)
* @return Void
*/
@ -59,7 +63,7 @@ public interface PetApi {
/**
* 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 body Pet object in the form of byte array (optional)
* @param cb callback method
* @return void
*/
@ -73,8 +77,8 @@ public interface PetApi {
* Deletes a pet
* Sync method
*
* @param petId Pet id to delete
* @param apiKey
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return Void
*/
@ -86,8 +90,8 @@ public interface PetApi {
/**
* Deletes a pet
* Async method
* @param petId Pet id to delete
* @param apiKey
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @param cb callback method
* @return void
*/
@ -101,7 +105,7 @@ public interface PetApi {
* Finds Pets by status
* Sync method
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for query
* @param status Status values that need to be considered for query (optional, default to available)
* @return List<Pet>
*/
@ -113,7 +117,7 @@ public interface PetApi {
/**
* Finds Pets by status
* Async method
* @param status Status values that need to be considered for query
* @param status Status values that need to be considered for query (optional, default to available)
* @param cb callback method
* @return void
*/
@ -127,7 +131,7 @@ public interface PetApi {
* Finds Pets by tags
* Sync method
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @param tags Tags to filter by (optional)
* @return List<Pet>
*/
@ -139,7 +143,7 @@ public interface PetApi {
/**
* Finds Pets by tags
* Async method
* @param tags Tags to filter by
* @param tags Tags to filter by (optional)
* @param cb callback method
* @return void
*/
@ -153,7 +157,7 @@ public interface PetApi {
* Find pet by ID
* Sync method
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return Pet
*/
@ -165,7 +169,7 @@ public interface PetApi {
/**
* Find pet by ID
* Async method
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @param cb callback method
* @return void
*/
@ -179,7 +183,7 @@ public interface PetApi {
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Sync method
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return InlineResponse200
*/
@ -191,7 +195,7 @@ public interface PetApi {
/**
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Async method
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @param cb callback method
* @return void
*/
@ -205,7 +209,7 @@ public interface PetApi {
* Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
* Sync method
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return byte[]
*/
@ -217,7 +221,7 @@ public interface PetApi {
/**
* Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
* Async method
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @param cb callback method
* @return void
*/
@ -231,7 +235,7 @@ public interface PetApi {
* Update an existing pet
* Sync 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 (optional)
* @return Void
*/
@ -243,7 +247,7 @@ public interface PetApi {
/**
* Update an existing pet
* 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 (optional)
* @param cb callback method
* @return void
*/
@ -257,9 +261,9 @@ public interface PetApi {
* 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
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return Void
*/
@ -272,9 +276,9 @@ public interface PetApi {
/**
* 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 petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @param cb callback method
* @return void
*/
@ -289,9 +293,9 @@ public interface PetApi {
* 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
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return Void
*/
@ -304,9 +308,9 @@ public interface PetApi {
/**
* 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 petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @param cb callback method
* @return void
*/
@ -318,3 +322,4 @@ public interface PetApi {
);
}

View File

@ -8,18 +8,22 @@ import retrofit.mime.*;
import io.swagger.client.model.Order;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
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
* @param orderId ID of the order that needs to be deleted (required)
* @return Void
*/
@ -31,7 +35,7 @@ public interface StoreApi {
/**
* Delete purchase order by ID
* Async method
* @param orderId ID of the order that needs to be deleted
* @param orderId ID of the order that needs to be deleted (required)
* @param cb callback method
* @return void
*/
@ -45,7 +49,7 @@ public interface StoreApi {
* Finds orders by status
* Sync method
* A single status value can be provided as a string
* @param status Status value that needs to be considered for query
* @param status Status value that needs to be considered for query (optional, default to placed)
* @return List<Order>
*/
@ -57,7 +61,7 @@ public interface StoreApi {
/**
* Finds orders by status
* Async method
* @param status Status value that needs to be considered for query
* @param status Status value that needs to be considered for query (optional, default to placed)
* @param cb callback method
* @return void
*/
@ -117,7 +121,7 @@ public interface StoreApi {
* Find purchase order by ID
* Sync method
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @param orderId ID of pet that needs to be fetched (required)
* @return Order
*/
@ -129,7 +133,7 @@ public interface StoreApi {
/**
* Find purchase order by ID
* Async method
* @param orderId ID of pet that needs to be fetched
* @param orderId ID of pet that needs to be fetched (required)
* @param cb callback method
* @return void
*/
@ -143,7 +147,7 @@ public interface StoreApi {
* Place an order for a pet
* Sync method
*
* @param body order placed for purchasing the pet
* @param body order placed for purchasing the pet (optional)
* @return Order
*/
@ -155,7 +159,7 @@ public interface StoreApi {
/**
* Place an order for a pet
* Async method
* @param body order placed for purchasing the pet
* @param body order placed for purchasing the pet (optional)
* @param cb callback method
* @return void
*/
@ -166,3 +170,4 @@ public interface StoreApi {
);
}

View File

@ -8,18 +8,22 @@ import retrofit.mime.*;
import io.swagger.client.model.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface UserApi {
/**
* Create user
* Sync method
* This can only be done by the logged in user.
* @param body Created user object
* @param body Created user object (optional)
* @return Void
*/
@ -31,7 +35,7 @@ public interface UserApi {
/**
* Create user
* Async method
* @param body Created user object
* @param body Created user object (optional)
* @param cb callback method
* @return void
*/
@ -45,7 +49,7 @@ public interface UserApi {
* Creates list of users with given input array
* Sync method
*
* @param body List of user object
* @param body List of user object (optional)
* @return Void
*/
@ -57,7 +61,7 @@ public interface UserApi {
/**
* Creates list of users with given input array
* Async method
* @param body List of user object
* @param body List of user object (optional)
* @param cb callback method
* @return void
*/
@ -71,7 +75,7 @@ public interface UserApi {
* Creates list of users with given input array
* Sync method
*
* @param body List of user object
* @param body List of user object (optional)
* @return Void
*/
@ -83,7 +87,7 @@ public interface UserApi {
/**
* Creates list of users with given input array
* Async method
* @param body List of user object
* @param body List of user object (optional)
* @param cb callback method
* @return void
*/
@ -97,7 +101,7 @@ public interface UserApi {
* Delete user
* Sync method
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @param username The name that needs to be deleted (required)
* @return Void
*/
@ -109,7 +113,7 @@ public interface UserApi {
/**
* Delete user
* Async method
* @param username The name that needs to be deleted
* @param username The name that needs to be deleted (required)
* @param cb callback method
* @return void
*/
@ -123,7 +127,7 @@ public interface UserApi {
* Get user by user name
* Sync 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. (required)
* @return User
*/
@ -135,7 +139,7 @@ public interface UserApi {
/**
* Get user by user name
* 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. (required)
* @param cb callback method
* @return void
*/
@ -149,8 +153,8 @@ public interface UserApi {
* Logs user into the system
* Sync method
*
* @param username The user name for login
* @param password The password for login in clear text
* @param username The user name for login (optional)
* @param password The password for login in clear text (optional)
* @return String
*/
@ -162,8 +166,8 @@ public interface UserApi {
/**
* Logs user into the system
* Async method
* @param username The user name for login
* @param password The password for login in clear text
* @param username The user name for login (optional)
* @param password The password for login in clear text (optional)
* @param cb callback method
* @return void
*/
@ -200,8 +204,8 @@ public interface UserApi {
* Updated user
* Sync method
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @param username name that need to be deleted (required)
* @param body Updated user object (optional)
* @return Void
*/
@ -213,8 +217,8 @@ public interface UserApi {
/**
* Updated user
* Async method
* @param username name that need to be deleted
* @param body Updated user object
* @param username name that need to be deleted (required)
* @param body Updated user object (optional)
* @param cb callback method
* @return void
*/
@ -225,3 +229,4 @@ public interface UserApi {
);
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Category {
@SerializedName("id")
@ -83,3 +85,5 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -7,16 +7,21 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class InlineResponse200 {
@SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>();
@SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
@SerializedName("name")
private String name = null;
@SerializedName("id")
private Long id = null;
@ -24,6 +29,9 @@ public class InlineResponse200 {
@SerializedName("category")
private Object category = null;
@SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>();
public enum StatusEnum {
@SerializedName("available")
@ -50,22 +58,27 @@ public enum StatusEnum {
@SerializedName("status")
private StatusEnum status = null;
@SerializedName("name")
private String name = null;
@SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
/**
**/
@ApiModelProperty(value = "")
public List<Tag> getTags() {
return tags;
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
/**
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ -91,6 +104,17 @@ public enum StatusEnum {
}
/**
**/
@ApiModelProperty(value = "")
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
/**
* pet status in the store
**/
@ -103,28 +127,6 @@ public enum StatusEnum {
}
/**
**/
@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) {
@ -135,17 +137,17 @@ public enum StatusEnum {
return false;
}
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(tags, inlineResponse200.tags) &&
return Objects.equals(photoUrls, inlineResponse200.photoUrls) &&
Objects.equals(name, inlineResponse200.name) &&
Objects.equals(id, inlineResponse200.id) &&
Objects.equals(category, inlineResponse200.category) &&
Objects.equals(status, inlineResponse200.status) &&
Objects.equals(name, inlineResponse200.name) &&
Objects.equals(photoUrls, inlineResponse200.photoUrls);
Objects.equals(tags, inlineResponse200.tags) &&
Objects.equals(status, inlineResponse200.status);
}
@Override
public int hashCode() {
return Objects.hash(tags, id, category, status, name, photoUrls);
return Objects.hash(photoUrls, name, id, category, tags, status);
}
@Override
@ -153,12 +155,12 @@ public enum StatusEnum {
StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).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();
}
@ -174,3 +176,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,73 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class Model200Response {
@SerializedName("name")
private Integer name = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Model200Response _200Response = (Model200Response) o;
return Objects.equals(name, _200Response.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model200Response {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,73 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class ModelReturn {
@SerializedName("return")
private Integer _return = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getReturn() {
return _return;
}
public void setReturn(Integer _return) {
this._return = _return;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(_return, _return._return);
}
@Override
public int hashCode() {
return Objects.hash(_return);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelReturn {\n");
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,89 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class Name {
@SerializedName("name")
private Integer name = null;
@SerializedName("snake_case")
private Integer snakeCase = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
/**
**/
@ApiModelProperty(value = "")
public Integer getSnakeCase() {
return snakeCase;
}
public void setSnakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Name name = (Name) o;
return Objects.equals(name, name.name) &&
Objects.equals(snakeCase, name.snakeCase);
}
@Override
public int hashCode() {
return Objects.hash(name, snakeCase);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Name {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -5,12 +5,14 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Order {
@SerializedName("id")
@ -169,3 +171,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -8,12 +8,14 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Pet {
@SerializedName("id")
@ -175,3 +177,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,73 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class SpecialModelName {
@SerializedName("$special[property.name]")
private Long specialPropertyName = null;
/**
**/
@ApiModelProperty(value = "")
public Long getSpecialPropertyName() {
return specialPropertyName;
}
public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(specialPropertyName, specialModelName.specialPropertyName);
}
@Override
public int hashCode() {
return Objects.hash(specialPropertyName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SpecialModelName {\n");
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Tag {
@SerializedName("id")
@ -83,3 +85,5 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class User {
@SerializedName("id")
@ -180,3 +182,5 @@ public class User {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,12 @@
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -12,17 +12,21 @@ import io.swagger.client.model.Pet;
import io.swagger.client.model.InlineResponse200;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface PetApi {
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store (optional)
* @return Call<Void>
*/
@ -35,7 +39,7 @@ public interface PetApi {
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
*
* @param body Pet object in the form of byte array
* @param body Pet object in the form of byte array (optional)
* @return Call<Void>
*/
@ -48,8 +52,8 @@ public interface PetApi {
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return Call<Void>
*/
@ -62,7 +66,7 @@ public interface PetApi {
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for query
* @param status Status values that need to be considered for query (optional, default to available)
* @return Call<List<Pet>>
*/
@ -75,7 +79,7 @@ public interface PetApi {
/**
* Finds Pets by tags
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @param tags Tags to filter by (optional)
* @return Call<List<Pet>>
*/
@ -88,7 +92,7 @@ public interface PetApi {
/**
* Find pet by ID
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return Call<Pet>
*/
@ -101,7 +105,7 @@ public interface PetApi {
/**
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return Call<InlineResponse200>
*/
@ -114,7 +118,7 @@ public interface PetApi {
/**
* Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return Call<byte[]>
*/
@ -127,7 +131,7 @@ public interface PetApi {
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store (optional)
* @return Call<Void>
*/
@ -140,9 +144,9 @@ public interface PetApi {
/**
* Updates a pet in the store with form data
*
* @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 petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return Call<Void>
*/
@ -156,9 +160,9 @@ public interface PetApi {
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return Call<Void>
*/
@ -170,3 +174,4 @@ public interface PetApi {
}

View File

@ -10,17 +10,21 @@ import okhttp3.RequestBody;
import io.swagger.client.model.Order;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface StoreApi {
/**
* Delete purchase order by ID
* 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
* @param orderId ID of the order that needs to be deleted (required)
* @return Call<Void>
*/
@ -33,7 +37,7 @@ public interface StoreApi {
/**
* Finds orders by status
* A single status value can be provided as a string
* @param status Status value that needs to be considered for query
* @param status Status value that needs to be considered for query (optional, default to placed)
* @return Call<List<Order>>
*/
@ -68,7 +72,7 @@ public interface StoreApi {
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @param orderId ID of pet that needs to be fetched (required)
* @return Call<Order>
*/
@ -81,7 +85,7 @@ public interface StoreApi {
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @param body order placed for purchasing the pet (optional)
* @return Call<Order>
*/
@ -92,3 +96,4 @@ public interface StoreApi {
}

View File

@ -10,17 +10,21 @@ import okhttp3.RequestBody;
import io.swagger.client.model.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface UserApi {
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @param body Created user object (optional)
* @return Call<Void>
*/
@ -33,7 +37,7 @@ public interface UserApi {
/**
* Creates list of users with given input array
*
* @param body List of user object
* @param body List of user object (optional)
* @return Call<Void>
*/
@ -46,7 +50,7 @@ public interface UserApi {
/**
* Creates list of users with given input array
*
* @param body List of user object
* @param body List of user object (optional)
* @return Call<Void>
*/
@ -59,7 +63,7 @@ public interface UserApi {
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @param username The name that needs to be deleted (required)
* @return Call<Void>
*/
@ -72,7 +76,7 @@ public interface UserApi {
/**
* Get user by user name
*
* @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. (required)
* @return Call<User>
*/
@ -85,8 +89,8 @@ public interface UserApi {
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @param username The user name for login (optional)
* @param password The password for login in clear text (optional)
* @return Call<String>
*/
@ -110,8 +114,8 @@ public interface UserApi {
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @param username name that need to be deleted (required)
* @param body Updated user object (optional)
* @return Call<Void>
*/
@ -122,3 +126,4 @@ public interface UserApi {
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Category {
@SerializedName("id")
@ -83,3 +85,5 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -7,16 +7,21 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class InlineResponse200 {
@SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>();
@SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
@SerializedName("name")
private String name = null;
@SerializedName("id")
private Long id = null;
@ -24,6 +29,9 @@ public class InlineResponse200 {
@SerializedName("category")
private Object category = null;
@SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>();
public enum StatusEnum {
@SerializedName("available")
@ -50,22 +58,27 @@ public enum StatusEnum {
@SerializedName("status")
private StatusEnum status = null;
@SerializedName("name")
private String name = null;
@SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
/**
**/
@ApiModelProperty(value = "")
public List<Tag> getTags() {
return tags;
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
/**
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ -91,6 +104,17 @@ public enum StatusEnum {
}
/**
**/
@ApiModelProperty(value = "")
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
/**
* pet status in the store
**/
@ -103,28 +127,6 @@ public enum StatusEnum {
}
/**
**/
@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) {
@ -135,17 +137,17 @@ public enum StatusEnum {
return false;
}
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(tags, inlineResponse200.tags) &&
return Objects.equals(photoUrls, inlineResponse200.photoUrls) &&
Objects.equals(name, inlineResponse200.name) &&
Objects.equals(id, inlineResponse200.id) &&
Objects.equals(category, inlineResponse200.category) &&
Objects.equals(status, inlineResponse200.status) &&
Objects.equals(name, inlineResponse200.name) &&
Objects.equals(photoUrls, inlineResponse200.photoUrls);
Objects.equals(tags, inlineResponse200.tags) &&
Objects.equals(status, inlineResponse200.status);
}
@Override
public int hashCode() {
return Objects.hash(tags, id, category, status, name, photoUrls);
return Objects.hash(photoUrls, name, id, category, tags, status);
}
@Override
@ -153,12 +155,12 @@ public enum StatusEnum {
StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).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();
}
@ -174,3 +176,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,73 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class Model200Response {
@SerializedName("name")
private Integer name = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Model200Response _200Response = (Model200Response) o;
return Objects.equals(name, _200Response.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model200Response {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,73 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class ModelReturn {
@SerializedName("return")
private Integer _return = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getReturn() {
return _return;
}
public void setReturn(Integer _return) {
this._return = _return;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(_return, _return._return);
}
@Override
public int hashCode() {
return Objects.hash(_return);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelReturn {\n");
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,89 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class Name {
@SerializedName("name")
private Integer name = null;
@SerializedName("snake_case")
private Integer snakeCase = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
/**
**/
@ApiModelProperty(value = "")
public Integer getSnakeCase() {
return snakeCase;
}
public void setSnakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Name name = (Name) o;
return Objects.equals(name, name.name) &&
Objects.equals(snakeCase, name.snakeCase);
}
@Override
public int hashCode() {
return Objects.hash(name, snakeCase);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Name {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -5,12 +5,14 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Order {
@SerializedName("id")
@ -169,3 +171,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -8,12 +8,14 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Pet {
@SerializedName("id")
@ -175,3 +177,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class SpecialModelName {
@SerializedName("$special[property.name]")
@ -67,3 +69,5 @@ public class SpecialModelName {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Tag {
@SerializedName("id")
@ -83,3 +85,5 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class User {
@SerializedName("id")
@ -180,3 +182,5 @@ public class User {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,12 @@
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -9,33 +9,24 @@ import retrofit2.http.*;
import okhttp3.RequestBody;
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;
import java.util.List;
import java.util.Map;
public interface PetApi {
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return Call<Void>
*/
@PUT("pet")
Observable<Void> updatePet(
@Body Pet body
);
public interface PetApi {
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store (optional)
* @return Call<Void>
*/
@ -45,10 +36,37 @@ public interface PetApi {
);
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
*
* @param body Pet object in the form of byte array (optional)
* @return Call<Void>
*/
@POST("pet?testing_byte_array=true")
Observable<Void> addPetUsingByteArray(
@Body byte[] body
);
/**
* Deletes a pet
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return Call<Void>
*/
@DELETE("pet/{petId}")
Observable<Void> deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey
);
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for query
* @param status Status values that need to be considered for query (optional, default to available)
* @return Call<List<Pet>>
*/
@ -61,7 +79,7 @@ public interface PetApi {
/**
* Finds Pets by tags
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @param tags Tags to filter by (optional)
* @return Call<List<Pet>>
*/
@ -74,7 +92,7 @@ public interface PetApi {
/**
* Find pet by ID
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return Call<Pet>
*/
@ -84,56 +102,10 @@ public interface PetApi {
);
/**
* Updates a pet in the store with form data
*
* @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 Call<Void>
*/
@FormUrlEncoded
@POST("pet/{petId}")
Observable<Void> updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status
);
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey
* @return Call<Void>
*/
@DELETE("pet/{petId}")
Observable<Void> deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey
);
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @return Call<Void>
*/
@Multipart
@POST("pet/{petId}/uploadImage")
Observable<Void> uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file\"; filename=\"file\"") RequestBody file
);
/**
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return Call<InlineResponse200>
*/
@ -146,7 +118,7 @@ public interface PetApi {
/**
* Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @param petId ID of pet that needs to be fetched (required)
* @return Call<byte[]>
*/
@ -157,16 +129,49 @@ public interface PetApi {
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
* Update an existing pet
*
* @param body Pet object in the form of byte array
* @param body Pet object that needs to be added to the store (optional)
* @return Call<Void>
*/
@POST("pet?testing_byte_array=true")
Observable<Void> addPetUsingByteArray(
@Body byte[] body
@PUT("pet")
Observable<Void> updatePet(
@Body Pet body
);
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return Call<Void>
*/
@FormUrlEncoded
@POST("pet/{petId}")
Observable<Void> updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status
);
/**
* uploads an image
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return Call<Void>
*/
@Multipart
@POST("pet/{petId}/uploadImage")
Observable<Void> uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file\"; filename=\"file\"") RequestBody file
);
}

View File

@ -10,17 +10,34 @@ import okhttp3.RequestBody;
import io.swagger.client.model.Order;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface StoreApi {
/**
* Delete purchase order by ID
* 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 (required)
* @return Call<Void>
*/
@DELETE("store/order/{orderId}")
Observable<Void> deleteOrder(
@Path("orderId") String orderId
);
/**
* Finds orders by status
* A single status value can be provided as a string
* @param status Status value that needs to be considered for query
* @param status Status value that needs to be considered for query (optional, default to placed)
* @return Call<List<Order>>
*/
@ -52,23 +69,10 @@ public interface StoreApi {
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return Call<Order>
*/
@POST("store/order")
Observable<Order> placeOrder(
@Body Order body
);
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @param orderId ID of pet that needs to be fetched (required)
* @return Call<Order>
*/
@ -79,16 +83,17 @@ public interface StoreApi {
/**
* Delete purchase order by ID
* 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 Call<Void>
* Place an order for a pet
*
* @param body order placed for purchasing the pet (optional)
* @return Call<Order>
*/
@DELETE("store/order/{orderId}")
Observable<Void> deleteOrder(
@Path("orderId") String orderId
@POST("store/order")
Observable<Order> placeOrder(
@Body Order body
);
}

View File

@ -10,17 +10,21 @@ import okhttp3.RequestBody;
import io.swagger.client.model.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface UserApi {
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @param body Created user object (optional)
* @return Call<Void>
*/
@ -33,7 +37,7 @@ public interface UserApi {
/**
* Creates list of users with given input array
*
* @param body List of user object
* @param body List of user object (optional)
* @return Call<Void>
*/
@ -46,7 +50,7 @@ public interface UserApi {
/**
* Creates list of users with given input array
*
* @param body List of user object
* @param body List of user object (optional)
* @return Call<Void>
*/
@ -56,11 +60,37 @@ public interface UserApi {
);
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted (required)
* @return Call<Void>
*/
@DELETE("user/{username}")
Observable<Void> deleteUser(
@Path("username") String username
);
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return Call<User>
*/
@GET("user/{username}")
Observable<User> getUserByName(
@Path("username") String username
);
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @param username The user name for login (optional)
* @param password The password for login in clear text (optional)
* @return Call<String>
*/
@ -81,24 +111,11 @@ public interface UserApi {
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return Call<User>
*/
@GET("user/{username}")
Observable<User> getUserByName(
@Path("username") String username
);
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @param username name that need to be deleted (required)
* @param body Updated user object (optional)
* @return Call<Void>
*/
@ -108,17 +125,5 @@ public interface UserApi {
);
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return Call<Void>
*/
@DELETE("user/{username}")
Observable<Void> deleteUser(
@Path("username") String username
);
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Category {
@SerializedName("id")
@ -83,3 +85,5 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -7,12 +7,14 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class InlineResponse200 {
@SerializedName("photoUrls")
@ -174,3 +176,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,73 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class Model200Response {
@SerializedName("name")
private Integer name = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Model200Response _200Response = (Model200Response) o;
return Objects.equals(name, _200Response.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model200Response {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,73 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class ModelReturn {
@SerializedName("return")
private Integer _return = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getReturn() {
return _return;
}
public void setReturn(Integer _return) {
this._return = _return;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(_return, _return._return);
}
@Override
public int hashCode() {
return Objects.hash(_return);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelReturn {\n");
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,89 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
public class Name {
@SerializedName("name")
private Integer name = null;
@SerializedName("snake_case")
private Integer snakeCase = null;
/**
**/
@ApiModelProperty(value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
/**
**/
@ApiModelProperty(value = "")
public Integer getSnakeCase() {
return snakeCase;
}
public void setSnakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Name name = (Name) o;
return Objects.equals(name, name.name) &&
Objects.equals(snakeCase, name.snakeCase);
}
@Override
public int hashCode() {
return Objects.hash(name, snakeCase);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Name {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -5,12 +5,14 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Order {
@SerializedName("id")
@ -169,3 +171,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -8,12 +8,14 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Pet {
@SerializedName("id")
@ -175,3 +177,5 @@ public enum StatusEnum {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class SpecialModelName {
@SerializedName("$special[property.name]")
@ -67,3 +69,5 @@ public class SpecialModelName {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class Tag {
@SerializedName("id")
@ -83,3 +85,5 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
}

View File

@ -4,12 +4,14 @@ import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
@ApiModel(description = "")
public class User {
@SerializedName("id")
@ -180,3 +182,5 @@ public class User {
return o.toString().replace("\n", "\n ");
}
}