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

@ -71,7 +71,7 @@ public class ApiClient {
dateFormat = ApiClient.buildDefaultDateFormat(); dateFormat = ApiClient.buildDefaultDateFormat();
// Set default User-Agent. // Set default User-Agent.
setUserAgent("Java-Swagger"); setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/java{{/httpUserAgent}}");
// Setup authentications (key: authentication name, value: authentication). // Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}} authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}

View File

@ -80,7 +80,7 @@ public class ApiClient {
this.json.setDateFormat((DateFormat) dateFormat.clone()); this.json.setDateFormat((DateFormat) dateFormat.clone());
// Set default User-Agent. // Set default User-Agent.
setUserAgent("Java-Swagger"); setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/java{{/httpUserAgent}}");
// Setup authentications (key: authentication name, value: authentication). // Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}} authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}

View File

@ -141,7 +141,7 @@ public class ApiClient {
this.lenientDatetimeFormat = true; this.lenientDatetimeFormat = true;
// Set default User-Agent. // Set default User-Agent.
setUserAgent("Java-Swagger"); setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/java{{/httpUserAgent}}");
// Setup authentications (key: authentication name, value: authentication). // Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}} authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}

View File

@ -110,7 +110,7 @@ class Configuration
* *
* @var string * @var string
*/ */
protected $userAgent = "PHP-Swagger/{{artifactVersion}}"; protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/php{{/httpUserAgent}}";
/** /**
* Debug switch (default set to false) * Debug switch (default set to false)

View File

@ -81,7 +81,7 @@ class ApiClient(object):
self.host = host self.host = host
self.cookie = cookie self.cookie = cookie
# Set default User-Agent. # Set default User-Agent.
self.user_agent = 'Python-Swagger/{{packageVersion}}' self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/python{{/httpUserAgent}}'
@property @property
def user_agent(self): def user_agent(self):

View File

@ -21,7 +21,7 @@ module {{moduleName}}
def initialize(config = Configuration.default) def initialize(config = Configuration.default)
@config = config @config = config
@user_agent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/#{VERSION}/ruby{{/httpUserAgent}}" @user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/#{VERSION}/ruby{{/httpUserAgent}}"
@default_headers = { @default_headers = {
'Content-Type' => "application/json", 'Content-Type' => "application/json",
'User-Agent' => @user_agent 'User-Agent' => @user_agent

View File

@ -3,7 +3,7 @@ package io.swagger.client;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class ApiException extends Exception { public class ApiException extends Exception {
private int code = 0; private int code = 0;
private Map<String, List<String>> responseHeaders = null; private Map<String, List<String>> responseHeaders = null;

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class Configuration { public class Configuration {
private static ApiClient defaultApiClient = new ApiClient(); private static ApiClient defaultApiClient = new ApiClient();

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class Pair { public class Pair {
private String name = ""; private String name = "";
private String value = ""; private String value = "";

View File

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

View File

@ -16,7 +16,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class PetApi { public class PetApi {
private ApiClient apiClient; private ApiClient apiClient;

View File

@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class StoreApi { public class StoreApi {
private ApiClient apiClient; private ApiClient apiClient;

View File

@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class UserApi { public class UserApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -194,7 +194,7 @@ public class UserApi {
}; };
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { "test_http_basic" };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class ApiKeyAuth implements Authentication { public class ApiKeyAuth implements Authentication {
private final String location; private final String location;
private final String paramName; private final String paramName;

View File

@ -9,7 +9,7 @@ import java.util.List;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class HttpBasicAuth implements Authentication { public class HttpBasicAuth implements Authentication {
private String username; private String username;
private String password; private String password;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class OAuth implements Authentication { public class OAuth implements Authentication {
private String accessToken; private String accessToken;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class Category { public class Category {
private Long id = null; private Long id = null;

View File

@ -13,7 +13,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class InlineResponse200 { public class InlineResponse200 {
private List<Tag> tags = new ArrayList<Tag>(); private List<Tag> tags = new ArrayList<Tag>();

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class ModelReturn { public class ModelReturn {
private Integer _return = null; private Integer _return = null;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class Name { public class Name {
private Integer name = null; private Integer name = null;

View File

@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class Order { public class Order {
private Long id = null; private Long id = null;

View File

@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class Pet { public class Pet {
private Long id = null; private Long id = null;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class SpecialModelName { public class SpecialModelName {
private Long specialPropertyName = null; private Long specialPropertyName = null;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class Tag { public class Tag {
private Long id = null; private Long id = null;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:47.322+08:00")
public class User { public class User {
private Long id = null; private Long id = null;

View File

@ -14,7 +14,7 @@ import feign.codec.EncodeException;
import feign.codec.Encoder; import feign.codec.Encoder;
import feign.RequestTemplate; import feign.RequestTemplate;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public class FormAwareEncoder implements Encoder { public class FormAwareEncoder implements Encoder {
public static final String UTF_8 = "utf-8"; public static final String UTF_8 = "utf-8";
private static final String LINE_FEED = "\r\n"; private static final String LINE_FEED = "\r\n";

View File

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

View File

@ -3,8 +3,8 @@ package io.swagger.client.api;
import io.swagger.client.ApiClient; import io.swagger.client.ApiClient;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import java.io.File;
import io.swagger.client.model.InlineResponse200; import io.swagger.client.model.InlineResponse200;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -12,23 +12,10 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import feign.*; import feign.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-03T12:04:41.120+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public interface PetApi extends ApiClient.Api { public interface PetApi extends ApiClient.Api {
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return void
*/
@RequestLine("PUT /pet")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
void updatePet(Pet body);
/** /**
* Add a new pet to the store * Add a new pet to the store
* *
@ -42,6 +29,34 @@ public interface PetApi extends ApiClient.Api {
}) })
void addPet(Pet body); void addPet(Pet body);
/**
* 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
* @return void
*/
@RequestLine("POST /pet?testing_byte_array=true")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
void addPetUsingByteArray(byte[] body);
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey
* @return void
*/
@RequestLine("DELETE /pet/{petId}")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
"apiKey: {apiKey}"
})
void deletePet(@Param("petId") Long petId, @Param("apiKey") String apiKey);
/** /**
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
@ -81,51 +96,6 @@ public interface PetApi extends ApiClient.Api {
}) })
Pet getPetById(@Param("petId") Long petId); Pet getPetById(@Param("petId") Long petId);
/**
* 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 void
*/
@RequestLine("POST /pet/{petId}")
@Headers({
"Content-type: application/x-www-form-urlencoded",
"Accepts: application/json",
})
void updatePetWithForm(@Param("petId") String petId, @Param("name") String name, @Param("status") String status);
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey
* @return void
*/
@RequestLine("DELETE /pet/{petId}")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
"apiKey: {apiKey}"
})
void deletePet(@Param("petId") Long petId, @Param("apiKey") 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 void
*/
@RequestLine("POST /pet/{petId}/uploadImage")
@Headers({
"Content-type: multipart/form-data",
"Accepts: application/json",
})
void uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file);
/** /**
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39; * 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 * Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
@ -153,16 +123,46 @@ public interface PetApi extends ApiClient.Api {
byte[] petPetIdtestingByteArraytrueGet(@Param("petId") Long petId); byte[] petPetIdtestingByteArraytrueGet(@Param("petId") Long petId);
/** /**
* 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
* @return void * @return void
*/ */
@RequestLine("POST /pet?testing_byte_array=true") @RequestLine("PUT /pet")
@Headers({ @Headers({
"Content-type: application/json", "Content-type: application/json",
"Accepts: application/json", "Accepts: application/json",
}) })
void addPetUsingByteArray(byte[] body); void updatePet(Pet body);
/**
* 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 void
*/
@RequestLine("POST /pet/{petId}")
@Headers({
"Content-type: application/x-www-form-urlencoded",
"Accepts: application/json",
})
void updatePetWithForm(@Param("petId") String petId, @Param("name") String name, @Param("status") String status);
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @return void
*/
@RequestLine("POST /pet/{petId}/uploadImage")
@Headers({
"Content-type: multipart/form-data",
"Accepts: application/json",
})
void uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file);
} }

View File

@ -10,10 +10,23 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import feign.*; import feign.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-03T12:04:41.120+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public interface StoreApi extends ApiClient.Api { 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
* @return void
*/
@RequestLine("DELETE /store/order/{orderId}")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
void deleteOrder(@Param("orderId") String orderId);
/** /**
* Finds orders by status * Finds orders by status
* A single status value can be provided as a string * A single status value can be provided as a string
@ -51,19 +64,6 @@ public interface StoreApi extends ApiClient.Api {
}) })
Object getInventoryInObject(); Object getInventoryInObject();
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return Order
*/
@RequestLine("POST /store/order")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
Order placeOrder(Order body);
/** /**
* Find purchase order by ID * Find purchase order by ID
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions * For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
@ -78,16 +78,16 @@ public interface StoreApi extends ApiClient.Api {
Order getOrderById(@Param("orderId") String orderId); Order getOrderById(@Param("orderId") String orderId);
/** /**
* Delete purchase order by ID * Place an order for a pet
* 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 body order placed for purchasing the pet
* @return void * @return Order
*/ */
@RequestLine("DELETE /store/order/{orderId}") @RequestLine("POST /store/order")
@Headers({ @Headers({
"Content-type: application/json", "Content-type: application/json",
"Accepts: application/json", "Accepts: application/json",
}) })
void deleteOrder(@Param("orderId") String orderId); Order placeOrder(Order body);
} }

View File

@ -10,7 +10,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import feign.*; import feign.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public interface UserApi extends ApiClient.Api { public interface UserApi extends ApiClient.Api {
@ -53,6 +53,32 @@ public interface UserApi extends ApiClient.Api {
}) })
void createUsersWithListInput(List<User> body); void createUsersWithListInput(List<User> body);
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return void
*/
@RequestLine("DELETE /user/{username}")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
void deleteUser(@Param("username") String username);
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
*/
@RequestLine("GET /user/{username}")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
User getUserByName(@Param("username") String username);
/** /**
* Logs user into the system * Logs user into the system
* *
@ -79,19 +105,6 @@ public interface UserApi extends ApiClient.Api {
}) })
void logoutUser(); void logoutUser();
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
*/
@RequestLine("GET /user/{username}")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
User getUserByName(@Param("username") String username);
/** /**
* Updated user * Updated user
* This can only be done by the logged in user. * This can only be done by the logged in user.
@ -106,17 +119,4 @@ public interface UserApi extends ApiClient.Api {
}) })
void updateUser(@Param("username") String username, User body); void updateUser(@Param("username") String username, User body);
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return void
*/
@RequestLine("DELETE /user/{username}")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
void deleteUser(@Param("username") String username);
} }

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public class Category { public class Category {
private Long id = null; private Long id = null;

View File

@ -2,35 +2,62 @@ package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-03T12:04:41.120+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public class InlineResponse200 { public class InlineResponse200 {
private String name = null; private List<Tag> tags = new ArrayList<Tag>();
private Long id = null; private Long id = null;
private Object category = null; private Object category = null;
public enum StatusEnum {
AVAILABLE("available"),
PENDING("pending"),
SOLD("sold");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return value;
}
}
private StatusEnum status = null;
private String name = null;
private List<String> photoUrls = new ArrayList<String>();
/** /**
**/ **/
public InlineResponse200 name(String name) { public InlineResponse200 tags(List<Tag> tags) {
this.name = name; this.tags = tags;
return this; return this;
} }
@ApiModelProperty(example = "doggie", value = "") @ApiModelProperty(example = "null", value = "")
@JsonProperty("name") @JsonProperty("tags")
public String getName() { public List<Tag> getTags() {
return name; return tags;
} }
public void setName(String name) { public void setTags(List<Tag> tags) {
this.name = name; this.tags = tags;
} }
@ -68,6 +95,58 @@ public class InlineResponse200 {
} }
/**
* pet status in the store
**/
public InlineResponse200 status(StatusEnum status) {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "pet status in the store")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
/**
**/
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 @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
@ -78,14 +157,17 @@ public class InlineResponse200 {
return false; return false;
} }
InlineResponse200 inlineResponse200 = (InlineResponse200) o; InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(this.name, inlineResponse200.name) && return Objects.equals(this.tags, inlineResponse200.tags) &&
Objects.equals(this.id, inlineResponse200.id) && Objects.equals(this.id, inlineResponse200.id) &&
Objects.equals(this.category, inlineResponse200.category); Objects.equals(this.category, inlineResponse200.category) &&
Objects.equals(this.status, inlineResponse200.status) &&
Objects.equals(this.name, inlineResponse200.name) &&
Objects.equals(this.photoUrls, inlineResponse200.photoUrls);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, id, category); return Objects.hash(tags, id, category, status, name, photoUrls);
} }
@Override @Override
@ -93,9 +175,12 @@ public class InlineResponse200 {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n"); 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(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).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("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }

View File

@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public class Order { public class Order {
private Long id = null; private Long id = null;

View File

@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public class Pet { public class Pet {
private Long id = null; private Long id = null;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public class Tag { public class Tag {
private Long id = null; private Long id = null;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00")
public class User { public class User {
private Long id = null; private Long id = null;

View File

@ -3,7 +3,7 @@ package io.swagger.client;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-28T16:23:25.238+01:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class ApiException extends Exception { public class ApiException extends Exception {
private int code = 0; private int code = 0;
private Map<String, List<String>> responseHeaders = null; private Map<String, List<String>> responseHeaders = null;

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-28T16:23:25.238+01:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class Configuration { public class Configuration {
private static ApiClient defaultApiClient = new ApiClient(); private static ApiClient defaultApiClient = new ApiClient();

View File

@ -8,7 +8,7 @@ import java.text.DateFormat;
import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.ContextResolver;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-28T16:23:25.238+01:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class JSON implements ContextResolver<ObjectMapper> { public class JSON implements ContextResolver<ObjectMapper> {
private ObjectMapper mapper; private ObjectMapper mapper;

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-28T16:23:25.238+01:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class Pair { public class Pair {
private String name = ""; private String name = "";
private String value = ""; private String value = "";

View File

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

View File

@ -8,15 +8,15 @@ import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType; import javax.ws.rs.core.GenericType;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import java.io.File;
import io.swagger.client.model.InlineResponse200; import io.swagger.client.model.InlineResponse200;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-03T12:04:39.601+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class PetApi { public class PetApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -37,46 +37,6 @@ public class PetApi {
} }
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @throws ApiException if fails to make API call
*/
public void updatePet(Pet body) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json", "application/xml"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth" };
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/** /**
* Add a new pet to the store * Add a new pet to the store
* *
@ -117,6 +77,95 @@ public class 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
* @throws ApiException if fails to make API call
*/
public void addPetUsingByteArray(byte[] body) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json", "application/xml"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth" };
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey
* @throws ApiException if fails to make API call
*/
public void deletePet(Long petId, String apiKey) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
}
// create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (apiKey != null)
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth" };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/** /**
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
@ -245,7 +294,7 @@ public class PetApi {
}; };
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" }; String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {}; GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
@ -253,6 +302,142 @@ public class 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
* @return InlineResponse200
* @throws ApiException if fails to make API call
*/
public InlineResponse200 getPetByIdInObject(Long petId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetByIdInObject");
}
// create path and map variables
String localVarPath = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
GenericType<InlineResponse200> localVarReturnType = new GenericType<InlineResponse200>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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
* @return byte[]
* @throws ApiException if fails to make API call
*/
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet");
}
// create path and map variables
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @throws ApiException if fails to make API call
*/
public void updatePet(Pet body) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json", "application/xml"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth" };
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/** /**
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
@ -305,55 +490,6 @@ public class PetApi {
} }
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey
* @throws ApiException if fails to make API call
*/
public void deletePet(Long petId, String apiKey) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
}
// create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (apiKey != null)
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth" };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/** /**
* uploads an image * uploads an image
* *
@ -402,142 +538,6 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/**
* 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
* @return InlineResponse200
* @throws ApiException if fails to make API call
*/
public InlineResponse200 getPetByIdInObject(Long petId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetByIdInObject");
}
// create path and map variables
String localVarPath = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
GenericType<InlineResponse200> localVarReturnType = new GenericType<InlineResponse200>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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
* @return byte[]
* @throws ApiException if fails to make API call
*/
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet");
}
// create path and map variables
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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
* @throws ApiException if fails to make API call
*/
public void addPetUsingByteArray(byte[] body) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json", "application/xml"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth" };
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }

View File

@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-03T12:04:39.601+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class StoreApi { public class StoreApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -35,6 +35,52 @@ public class 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
* @throws ApiException if fails to make API call
*/
public void deleteOrder(String orderId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/** /**
* Finds orders by status * Finds orders by status
* A single status value can be provided as a string * A single status value can be provided as a string
@ -161,6 +207,54 @@ public class 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
* @return Order
* @throws ApiException if fails to make API call
*/
public Order getOrderById(String orderId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "test_api_key_header", "test_api_key_query" };
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/** /**
* Place an order for a pet * Place an order for a pet
* *
@ -203,98 +297,4 @@ public class 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
* @return Order
* @throws ApiException if fails to make API call
*/
public Order getOrderById(String orderId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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
* @throws ApiException if fails to make API call
*/
public void deleteOrder(String orderId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
} }

View File

@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-29T12:55:37.248+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class UserApi { public class UserApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -155,6 +155,100 @@ public class UserApi {
} }
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @throws ApiException if fails to make API call
*/
public void deleteUser(String username) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "test_http_basic" };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
* @throws ApiException if fails to make API call
*/
public User getUserByName(String username) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<User> localVarReturnType = new GenericType<User>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/** /**
* Logs user into the system * Logs user into the system
* *
@ -241,54 +335,6 @@ public class UserApi {
} }
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
* @throws ApiException if fails to make API call
*/
public User getUserByName(String username) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<User> localVarReturnType = new GenericType<User>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/** /**
* Updated user * Updated user
* This can only be done by the logged in user. * This can only be done by the logged in user.
@ -336,50 +382,4 @@ public class UserApi {
} }
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @throws ApiException if fails to make API call
*/
public void deleteUser(String username) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
} }

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-28T16:23:25.238+01:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class ApiKeyAuth implements Authentication { public class ApiKeyAuth implements Authentication {
private final String location; private final String location;
private final String paramName; private final String paramName;

View File

@ -9,7 +9,7 @@ import java.util.List;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-28T16:23:25.238+01:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class HttpBasicAuth implements Authentication { public class HttpBasicAuth implements Authentication {
private String username; private String username;
private String password; private String password;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-28T16:23:25.238+01:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class OAuth implements Authentication { public class OAuth implements Authentication {
private String accessToken; private String accessToken;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class Category { public class Category {
private Long id = null; private Long id = null;

View File

@ -2,35 +2,62 @@ package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-03T12:04:39.601+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class InlineResponse200 { public class InlineResponse200 {
private String name = null; private List<Tag> tags = new ArrayList<Tag>();
private Long id = null; private Long id = null;
private Object category = null; private Object category = null;
public enum StatusEnum {
AVAILABLE("available"),
PENDING("pending"),
SOLD("sold");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return value;
}
}
private StatusEnum status = null;
private String name = null;
private List<String> photoUrls = new ArrayList<String>();
/** /**
**/ **/
public InlineResponse200 name(String name) { public InlineResponse200 tags(List<Tag> tags) {
this.name = name; this.tags = tags;
return this; return this;
} }
@ApiModelProperty(example = "doggie", value = "") @ApiModelProperty(example = "null", value = "")
@JsonProperty("name") @JsonProperty("tags")
public String getName() { public List<Tag> getTags() {
return name; return tags;
} }
public void setName(String name) { public void setTags(List<Tag> tags) {
this.name = name; this.tags = tags;
} }
@ -68,6 +95,58 @@ public class InlineResponse200 {
} }
/**
* pet status in the store
**/
public InlineResponse200 status(StatusEnum status) {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "pet status in the store")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
/**
**/
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 @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
@ -78,14 +157,17 @@ public class InlineResponse200 {
return false; return false;
} }
InlineResponse200 inlineResponse200 = (InlineResponse200) o; InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(this.name, inlineResponse200.name) && return Objects.equals(this.tags, inlineResponse200.tags) &&
Objects.equals(this.id, inlineResponse200.id) && Objects.equals(this.id, inlineResponse200.id) &&
Objects.equals(this.category, inlineResponse200.category); Objects.equals(this.category, inlineResponse200.category) &&
Objects.equals(this.status, inlineResponse200.status) &&
Objects.equals(this.name, inlineResponse200.name) &&
Objects.equals(this.photoUrls, inlineResponse200.photoUrls);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, id, category); return Objects.hash(tags, id, category, status, name, photoUrls);
} }
@Override @Override
@ -93,9 +175,12 @@ public class InlineResponse200 {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n"); 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(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).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("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }

View File

@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class Order { public class Order {
private Long id = null; private Long id = null;

View File

@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class Pet { public class Pet {
private Long id = null; private Long id = null;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class Tag { public class Tag {
private Long id = null; private Long id = null;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:48.808+08:00")
public class User { public class User {
private Long id = null; private Long id = null;

View File

@ -3,7 +3,7 @@ package io.swagger.client;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-15T18:20:42.151+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:51.831+08:00")
public class ApiException extends Exception { public class ApiException extends Exception {
private int code = 0; private int code = 0;
private Map<String, List<String>> responseHeaders = null; private Map<String, List<String>> responseHeaders = null;

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-15T18:20:42.151+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:51.831+08:00")
public class Configuration { public class Configuration {
private static ApiClient defaultApiClient = new ApiClient(); private static ApiClient defaultApiClient = new ApiClient();

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-15T18:20:42.151+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:51.831+08:00")
public class Pair { public class Pair {
private String name = ""; private String name = "";
private String value = ""; private String value = "";

View File

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

View File

@ -45,6 +45,110 @@ public class StoreApi {
} }
/* Build call for deleteOrder */
private Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* 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
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteOrder(String orderId) throws ApiException {
deleteOrderWithHttpInfo(orderId);
}
/**
* 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 ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> deleteOrderWithHttpInfo(String orderId) throws ApiException {
Call call = deleteOrderCall(orderId, null, null);
return apiClient.execute(call);
}
/**
* Delete purchase order by ID (asynchronously)
* 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 callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public Call deleteOrderAsync(String orderId, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
Call call = deleteOrderCall(orderId, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/* Build call for findOrdersByStatus */ /* Build call for findOrdersByStatus */
private Call findOrdersByStatusCall(String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private Call findOrdersByStatusCall(String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
@ -347,6 +451,114 @@ public class StoreApi {
return call; return call;
} }
/* Build call for getOrderById */
private Call getOrderByIdCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "test_api_key_header", "test_api_key_query" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* 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
* @return Order
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Order getOrderById(String orderId) throws ApiException {
ApiResponse<Order> resp = getOrderByIdWithHttpInfo(orderId);
return resp.getData();
}
/**
* 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
* @return ApiResponse<Order>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Order> getOrderByIdWithHttpInfo(String orderId) throws ApiException {
Call call = getOrderByIdCall(orderId, null, null);
Type localVarReturnType = new TypeToken<Order>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find purchase order by ID (asynchronously)
* 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 callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public Call getOrderByIdAsync(String orderId, final ApiCallback<Order> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Order>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for placeOrder */ /* Build call for placeOrder */
private Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; Object localVarPostBody = body;
@ -449,216 +661,4 @@ public class StoreApi {
return call; return call;
} }
/* Build call for getOrderById */
private Call getOrderByIdCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* 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
* @return Order
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Order getOrderById(String orderId) throws ApiException {
ApiResponse<Order> resp = getOrderByIdWithHttpInfo(orderId);
return resp.getData();
}
/**
* 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
* @return ApiResponse<Order>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Order> getOrderByIdWithHttpInfo(String orderId) throws ApiException {
Call call = getOrderByIdCall(orderId, null, null);
Type localVarReturnType = new TypeToken<Order>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find purchase order by ID (asynchronously)
* 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 callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public Call getOrderByIdAsync(String orderId, final ApiCallback<Order> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Order>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for deleteOrder */
private Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* 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
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteOrder(String orderId) throws ApiException {
deleteOrderWithHttpInfo(orderId);
}
/**
* 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 ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> deleteOrderWithHttpInfo(String orderId) throws ApiException {
Call call = deleteOrderCall(orderId, null, null);
return apiClient.execute(call);
}
/**
* Delete purchase order by ID (asynchronously)
* 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 callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public Call deleteOrderAsync(String orderId, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
Call call = deleteOrderCall(orderId, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
} }

View File

@ -339,6 +339,218 @@ public class UserApi {
return call; return call;
} }
/* Build call for deleteUser */
private Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "test_http_basic" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteUser(String username) throws ApiException {
deleteUserWithHttpInfo(username);
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> deleteUserWithHttpInfo(String username) throws ApiException {
Call call = deleteUserCall(username, null, null);
return apiClient.execute(call);
}
/**
* Delete user (asynchronously)
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public Call deleteUserAsync(String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
Call call = deleteUserCall(username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/* Build call for getUserByName */
private Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public User getUserByName(String username) throws ApiException {
ApiResponse<User> resp = getUserByNameWithHttpInfo(username);
return resp.getData();
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiResponse<User>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
Call call = getUserByNameCall(username, null, null);
Type localVarReturnType = new TypeToken<User>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get user by user name (asynchronously)
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public Call getUserByNameAsync(String username, final ApiCallback<User> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
Call call = getUserByNameCall(username, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<User>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for loginUser */ /* Build call for loginUser */
private Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
@ -543,114 +755,6 @@ public class UserApi {
return call; return call;
} }
/* Build call for getUserByName */
private Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public User getUserByName(String username) throws ApiException {
ApiResponse<User> resp = getUserByNameWithHttpInfo(username);
return resp.getData();
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiResponse<User>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
Call call = getUserByNameCall(username, null, null);
Type localVarReturnType = new TypeToken<User>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get user by user name (asynchronously)
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public Call getUserByNameAsync(String username, final ApiCallback<User> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
Call call = getUserByNameCall(username, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<User>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for updateUser */ /* Build call for updateUser */
private Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; Object localVarPostBody = body;
@ -758,108 +862,4 @@ public class UserApi {
return call; return call;
} }
/* Build call for deleteUser */
private Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteUser(String username) throws ApiException {
deleteUserWithHttpInfo(username);
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> deleteUserWithHttpInfo(String username) throws ApiException {
Call call = deleteUserCall(username, null, null);
return apiClient.execute(call);
}
/**
* Delete user (asynchronously)
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public Call deleteUserAsync(String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
Call call = deleteUserCall(username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
} }

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-15T18:20:42.151+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:51.831+08:00")
public class ApiKeyAuth implements Authentication { public class ApiKeyAuth implements Authentication {
private final String location; private final String location;
private final String paramName; private final String paramName;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-15T18:20:42.151+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:51.831+08:00")
public class OAuth implements Authentication { public class OAuth implements Authentication {
private String accessToken; private String accessToken;

View File

@ -3,6 +3,9 @@ package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; 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; import com.google.gson.annotations.SerializedName;
@ -12,8 +15,8 @@ import com.google.gson.annotations.SerializedName;
@ApiModel(description = "") @ApiModel(description = "")
public class InlineResponse200 { public class InlineResponse200 {
@SerializedName("name") @SerializedName("tags")
private String name = null; private List<Tag> tags = new ArrayList<Tag>();
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;
@ -22,15 +25,47 @@ public class InlineResponse200 {
private Object category = null; 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 = "") @ApiModelProperty(value = "")
public String getName() { public List<Tag> getTags() {
return name; return tags;
} }
public void setName(String name) { public void setTags(List<Tag> tags) {
this.name = name; 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 @Override
public boolean equals(Object o) { public boolean equals(Object o) {
@ -66,14 +135,17 @@ public class InlineResponse200 {
return false; return false;
} }
InlineResponse200 inlineResponse200 = (InlineResponse200) o; InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(this.name, inlineResponse200.name) && return Objects.equals(this.tags, inlineResponse200.tags) &&
Objects.equals(this.id, inlineResponse200.id) && Objects.equals(this.id, inlineResponse200.id) &&
Objects.equals(this.category, inlineResponse200.category); Objects.equals(this.category, inlineResponse200.category) &&
Objects.equals(this.status, inlineResponse200.status) &&
Objects.equals(this.name, inlineResponse200.name) &&
Objects.equals(this.photoUrls, inlineResponse200.photoUrls);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, id, category); return Objects.hash(tags, id, category, status, name, photoUrls);
} }
@Override @Override
@ -81,9 +153,12 @@ public class InlineResponse200 {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n"); 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(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).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("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "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 { public class StringUtil {
/** /**
* Check if the given array contains the given value (with case-insensitive comparison). * Check if the given array contains the given value (with case-insensitive comparison).

View File

@ -7,8 +7,8 @@ import retrofit.http.*;
import retrofit.mime.*; import retrofit.mime.*;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import java.io.File;
import io.swagger.client.model.InlineResponse200; import io.swagger.client.model.InlineResponse200;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -17,32 +17,6 @@ import java.util.Map;
public interface PetApi { 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 * Add a new pet to the store
* Sync method * Sync method
@ -69,6 +43,60 @@ public interface PetApi {
@Body Pet body, Callback<Void> cb @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 * Finds Pets by status
* Sync method * Sync method
@ -147,98 +175,6 @@ public interface PetApi {
@Path("petId") Long petId, Callback<Pet> cb @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; * Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Sync method * 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 * 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 * @return Void
*/ */
@POST("/pet?testing_byte_array=true") @PUT("/pet")
Void addPetUsingByteArray( Void updatePet(
@Body byte[] body @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 * 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 * @param cb callback method
* @return void * @return void
*/ */
@POST("/pet?testing_byte_array=true") @PUT("/pet")
void addPetUsingByteArray( void updatePet(
@Body byte[] body, Callback<Void> cb @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 { 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 * Finds orders by status
* Sync method * Sync method
@ -87,32 +113,6 @@ public interface StoreApi {
Callback<Object> cb 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 * Find purchase order by ID
* Sync method * Sync method
@ -140,29 +140,29 @@ public interface StoreApi {
); );
/** /**
* Delete purchase order by ID * Place an order for a pet
* Sync method * 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 body order placed for purchasing the pet
* @return Void * @return Order
*/ */
@DELETE("/store/order/{orderId}") @POST("/store/order")
Void deleteOrder( Order placeOrder(
@Path("orderId") String orderId @Body Order body
); );
/** /**
* Delete purchase order by ID * Place an order for a pet
* Async method * 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 * @param cb callback method
* @return void * @return void
*/ */
@DELETE("/store/order/{orderId}") @POST("/store/order")
void deleteOrder( void placeOrder(
@Path("orderId") String orderId, Callback<Void> cb @Body Order body, Callback<Order> cb
); );
} }

View File

@ -93,6 +93,58 @@ public interface UserApi {
@Body List<User> body, Callback<Void> cb @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 * Logs user into the system
* Sync method * Sync method
@ -144,32 +196,6 @@ public interface UserApi {
Callback<Void> cb 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 * Updated user
* Sync method * Sync method
@ -198,30 +224,4 @@ public interface UserApi {
@Path("username") String username, @Body User body, Callback<Void> cb @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 java.util.Objects;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; 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; import com.google.gson.annotations.SerializedName;
@ -12,8 +15,8 @@ import com.google.gson.annotations.SerializedName;
@ApiModel(description = "") @ApiModel(description = "")
public class InlineResponse200 { public class InlineResponse200 {
@SerializedName("name") @SerializedName("tags")
private String name = null; private List<Tag> tags = new ArrayList<Tag>();
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;
@ -22,15 +25,47 @@ public class InlineResponse200 {
private Object category = null; 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 = "") @ApiModelProperty(value = "")
public String getName() { public List<Tag> getTags() {
return name; return tags;
} }
public void setName(String name) { public void setTags(List<Tag> tags) {
this.name = name; 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 @Override
public boolean equals(Object o) { public boolean equals(Object o) {
@ -66,14 +135,17 @@ public class InlineResponse200 {
return false; return false;
} }
InlineResponse200 inlineResponse200 = (InlineResponse200) o; InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(name, inlineResponse200.name) && return Objects.equals(tags, inlineResponse200.tags) &&
Objects.equals(id, inlineResponse200.id) && 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 @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, id, category); return Objects.hash(tags, id, category, status, name, photoUrls);
} }
@Override @Override
@ -81,9 +153,12 @@ public class InlineResponse200 {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n"); 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(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).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("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }

View File

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

View File

@ -9,8 +9,8 @@ import retrofit2.http.*;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import java.io.File;
import io.swagger.client.model.InlineResponse200; import io.swagger.client.model.InlineResponse200;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -19,19 +19,6 @@ import java.util.Map;
public interface PetApi { public interface PetApi {
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return Call<Void>
*/
@PUT("pet")
Call<Void> updatePet(
@Body Pet body
);
/** /**
* Add a new pet to the store * Add a new pet to the store
* *
@ -45,6 +32,33 @@ 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
* @return Call<Void>
*/
@POST("pet?testing_byte_array=true")
Call<Void> addPetUsingByteArray(
@Body byte[] body
);
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey
* @return Call<Void>
*/
@DELETE("pet/{petId}")
Call<Void> deletePet(
@Path("petId") Long petId, @Header("api_key") String apiKey
);
/** /**
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
@ -84,52 +98,6 @@ 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}")
Call<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}")
Call<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")
Call<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; * 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 * Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
@ -157,15 +125,47 @@ 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
* @return Call<Void> * @return Call<Void>
*/ */
@POST("pet?testing_byte_array=true") @PUT("pet")
Call<Void> addPetUsingByteArray( Call<Void> updatePet(
@Body byte[] body @Body Pet body
);
/**
* 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}")
Call<Void> updatePetWithForm(
@Path("petId") String petId, @Field("name") String name, @Field("status") String status
);
/**
* 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")
Call<Void> uploadFile(
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file\"; filename=\"file\"") RequestBody file
); );

View File

@ -17,6 +17,19 @@ import java.util.Map;
public interface StoreApi { 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>
*/
@DELETE("store/order/{orderId}")
Call<Void> deleteOrder(
@Path("orderId") String orderId
);
/** /**
* Finds orders by status * Finds orders by status
* A single status value can be provided as a string * A single status value can be provided as a string
@ -52,19 +65,6 @@ public interface StoreApi {
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return Call<Order>
*/
@POST("store/order")
Call<Order> placeOrder(
@Body Order body
);
/** /**
* Find purchase order by ID * Find purchase order by ID
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions * For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
@ -79,15 +79,15 @@ public interface StoreApi {
/** /**
* Delete purchase order by ID * Place an order for a pet
* 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 body order placed for purchasing the pet
* @return Call<Void> * @return Call<Order>
*/ */
@DELETE("store/order/{orderId}") @POST("store/order")
Call<Void> deleteOrder( Call<Order> placeOrder(
@Path("orderId") String orderId @Body Order body
); );

View File

@ -56,6 +56,32 @@ 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}")
Call<Void> deleteUser(
@Path("username") String username
);
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return Call<User>
*/
@GET("user/{username}")
Call<User> getUserByName(
@Path("username") String username
);
/** /**
* Logs user into the system * Logs user into the system
* *
@ -81,19 +107,6 @@ 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}")
Call<User> getUserByName(
@Path("username") String username
);
/** /**
* Updated user * Updated user
* This can only be done by the logged in user. * This can only be done by the logged in user.
@ -108,17 +121,4 @@ 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}")
Call<Void> deleteUser(
@Path("username") String username
);
} }

View File

@ -15,11 +15,8 @@ import com.google.gson.annotations.SerializedName;
@ApiModel(description = "") @ApiModel(description = "")
public class InlineResponse200 { public class InlineResponse200 {
@SerializedName("photoUrls") @SerializedName("tags")
private List<String> photoUrls = new ArrayList<String>(); private List<Tag> tags = new ArrayList<Tag>();
@SerializedName("name")
private String name = null;
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;
@ -27,9 +24,6 @@ public class InlineResponse200 {
@SerializedName("category") @SerializedName("category")
private Object category = null; private Object category = null;
@SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>();
public enum StatusEnum { public enum StatusEnum {
@SerializedName("available") @SerializedName("available")
@ -56,27 +50,22 @@ public enum StatusEnum {
@SerializedName("status") @SerializedName("status")
private StatusEnum status = null; private StatusEnum status = null;
@SerializedName("name")
private String name = null;
@SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
/** /**
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public List<String> getPhotoUrls() { public List<Tag> getTags() {
return photoUrls; return tags;
} }
public void setPhotoUrls(List<String> photoUrls) { public void setTags(List<Tag> tags) {
this.photoUrls = photoUrls; this.tags = tags;
}
/**
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
} }
@ -102,17 +91,6 @@ 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 * pet status in the store
**/ **/
@ -125,6 +103,28 @@ 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 @Override
public boolean equals(Object o) { public boolean equals(Object o) {
@ -135,17 +135,17 @@ public enum StatusEnum {
return false; return false;
} }
InlineResponse200 inlineResponse200 = (InlineResponse200) o; InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(photoUrls, inlineResponse200.photoUrls) && return Objects.equals(tags, inlineResponse200.tags) &&
Objects.equals(name, inlineResponse200.name) &&
Objects.equals(id, inlineResponse200.id) && Objects.equals(id, inlineResponse200.id) &&
Objects.equals(category, inlineResponse200.category) && Objects.equals(category, inlineResponse200.category) &&
Objects.equals(tags, inlineResponse200.tags) && Objects.equals(status, inlineResponse200.status) &&
Objects.equals(status, inlineResponse200.status); Objects.equals(name, inlineResponse200.name) &&
Objects.equals(photoUrls, inlineResponse200.photoUrls);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(photoUrls, name, id, category, tags, status); return Objects.hash(tags, id, category, status, name, photoUrls);
} }
@Override @Override
@ -153,12 +153,12 @@ public enum StatusEnum {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n"); sb.append("class InlineResponse200 {\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).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(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }

View File

@ -397,6 +397,11 @@ class UserApi
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// this endpoint requires HTTP basic authentication
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {
$headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
}
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(

View File

@ -110,7 +110,7 @@ class Configuration
* *
* @var string * @var string
*/ */
protected $userAgent = "PHP-Swagger/1.0.0"; protected $userAgent = "Swagger-Codegen/1.0.0/php";
/** /**
* Debug switch (default set to false) * Debug switch (default set to false)

View File

@ -81,7 +81,7 @@ class ApiClient(object):
self.host = host self.host = host
self.cookie = cookie self.cookie = cookie
# Set default User-Agent. # Set default User-Agent.
self.user_agent = 'Python-Swagger/1.0.0' self.user_agent = 'Swagger-Codegen/1.0.0/python'
@property @property
def user_agent(self): def user_agent(self):

View File

@ -330,7 +330,7 @@ class UserApi(object):
select_header_content_type([]) select_header_content_type([])
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = ['test_http_basic']
response = self.api_client.call_api(resource_path, 'DELETE', response = self.api_client.call_api(resource_path, 'DELETE',
path_params, path_params,

View File

@ -231,6 +231,13 @@ class Configuration(object):
'key': 'api_key', 'key': 'api_key',
'value': self.get_api_key_with_prefix('api_key') 'value': self.get_api_key_with_prefix('api_key')
}, },
'test_http_basic':
{
'type': 'basic',
'in': 'header',
'key': 'Authorization',
'value': self.get_basic_auth_token()
},
'test_api_client_secret': 'test_api_client_secret':
{ {
'type': 'api_key', 'type': 'api_key',