mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-08 08:30:56 +00:00
Merge pull request #2376 from wing328/user_agent_update
Update User-Agent for Ruby, Python, PHP, Java, Android
This commit is contained in:
commit
d02d3df158
@ -115,10 +115,7 @@ public class Generate implements Runnable {
|
||||
@Option(name = {"--release-note"}, title = "release note", description = CodegenConstants.RELEASE_NOTE_DESC)
|
||||
private String releaseNote;
|
||||
|
||||
@Option(name = {"--release-version"}, title = "release version", description = CodegenConstants.RELEASE_VERSION_DESC)
|
||||
private String releaseVersion;
|
||||
|
||||
@Option(name = {"--http-user-agent"}, title = "http user agent", description = CodegenConstants.HTTP_USER_AGENT)
|
||||
@Option(name = {"--http-user-agent"}, title = "http user agent", description = CodegenConstants.HTTP_USER_AGENT_DESC)
|
||||
private String httpUserAgent;
|
||||
|
||||
@Override
|
||||
@ -210,10 +207,6 @@ public class Generate implements Runnable {
|
||||
configurator.setReleaseNote(releaseNote);
|
||||
}
|
||||
|
||||
if (isNotEmpty(releaseVersion)) {
|
||||
configurator.setReleaseVersion(releaseVersion);
|
||||
}
|
||||
|
||||
if (isNotEmpty(httpUserAgent)) {
|
||||
configurator.setHttpUserAgent(httpUserAgent);
|
||||
}
|
||||
|
@ -180,10 +180,6 @@ public interface CodegenConfig {
|
||||
|
||||
String getReleaseNote();
|
||||
|
||||
void setReleaseVersion(String releaseVersion);
|
||||
|
||||
String getReleaseVersion();
|
||||
|
||||
void setHttpUserAgent(String httpUserAgent);
|
||||
|
||||
String getHttpUserAgent();
|
||||
|
@ -100,10 +100,7 @@ public class CodegenConstants {
|
||||
public static final String RELEASE_NOTE = "releaseNote";
|
||||
public static final String RELEASE_NOTE_DESC = "Release note, default to 'Minor update'.";
|
||||
|
||||
public static final String RELEASE_VERSION = "releaseVersion";
|
||||
public static final String RELEASE_VERSION_DESC= "Release version, e.g. 1.2.5, default to 0.1.0.";
|
||||
|
||||
public static final String HTTP_USER_AGENT = "httpUserAgent";
|
||||
public static final String HTTP_USER_AGENT_DESC = "HTTP user agent, e.g. codegen_csharp_api_client, default to 'Swagger-Codegen/{releaseVersion}}/{language}'";
|
||||
public static final String HTTP_USER_AGENT_DESC = "HTTP user agent, e.g. codegen_csharp_api_client, default to 'Swagger-Codegen/{packageVersion}}/{language}'";
|
||||
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class DefaultCodegen {
|
||||
protected String library;
|
||||
protected Boolean sortParamsByRequiredFlag = true;
|
||||
protected Boolean ensureUniqueParams = true;
|
||||
protected String gitUserId, gitRepoId, releaseNote, releaseVersion;
|
||||
protected String gitUserId, gitRepoId, releaseNote;
|
||||
protected String httpUserAgent;
|
||||
|
||||
public List<CliOption> cliOptions() {
|
||||
@ -2414,24 +2414,6 @@ public class DefaultCodegen {
|
||||
return releaseNote;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set release version.
|
||||
*
|
||||
* @param releaseVersion Release version
|
||||
*/
|
||||
public void setReleaseVersion(String releaseVersion) {
|
||||
this.releaseVersion = releaseVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Release version
|
||||
*
|
||||
* @return Release version
|
||||
*/
|
||||
public String getReleaseVersion() {
|
||||
return releaseVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set HTTP user agent.
|
||||
*
|
||||
|
@ -63,7 +63,6 @@ public class CodegenConfigurator {
|
||||
private String gitUserId="YOUR_GIT_USR_ID";
|
||||
private String gitRepoId="YOUR_GIT_REPO_ID";
|
||||
private String releaseNote="Minor update";
|
||||
private String releaseVersion="0.1.0";
|
||||
private String httpUserAgent;
|
||||
|
||||
private final Map<String, String> dynamicProperties = new HashMap<String, String>(); //the map that holds the JsonAnySetter/JsonAnyGetter values
|
||||
@ -327,15 +326,6 @@ public class CodegenConfigurator {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getReleaseVersion() {
|
||||
return releaseVersion;
|
||||
}
|
||||
|
||||
public CodegenConfigurator setReleaseVersion(String releaseVersion) {
|
||||
this.releaseVersion = releaseVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getHttpUserAgent() {
|
||||
return httpUserAgent;
|
||||
}
|
||||
@ -374,7 +364,6 @@ public class CodegenConfigurator {
|
||||
checkAndSetAdditionalProperty(modelNameSuffix, CodegenConstants.MODEL_NAME_SUFFIX);
|
||||
checkAndSetAdditionalProperty(gitUserId, CodegenConstants.GIT_USER_ID);
|
||||
checkAndSetAdditionalProperty(gitRepoId, CodegenConstants.GIT_REPO_ID);
|
||||
checkAndSetAdditionalProperty(releaseVersion, CodegenConstants.RELEASE_VERSION);
|
||||
checkAndSetAdditionalProperty(releaseNote, CodegenConstants.RELEASE_NOTE);
|
||||
checkAndSetAdditionalProperty(httpUserAgent, CodegenConstants.HTTP_USER_AGENT);
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class ApiClient {
|
||||
dateFormat = ApiClient.buildDefaultDateFormat();
|
||||
|
||||
// Set default User-Agent.
|
||||
setUserAgent("Java-Swagger");
|
||||
setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/java{{/httpUserAgent}}");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}
|
||||
|
@ -80,7 +80,7 @@ public class ApiClient {
|
||||
this.json.setDateFormat((DateFormat) dateFormat.clone());
|
||||
|
||||
// Set default User-Agent.
|
||||
setUserAgent("Java-Swagger");
|
||||
setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/java{{/httpUserAgent}}");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}
|
||||
|
@ -141,7 +141,7 @@ public class ApiClient {
|
||||
this.lenientDatetimeFormat = true;
|
||||
|
||||
// Set default User-Agent.
|
||||
setUserAgent("Java-Swagger");
|
||||
setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/java{{/httpUserAgent}}");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}
|
||||
|
@ -83,7 +83,7 @@ public class ApiInvoker {
|
||||
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
|
||||
// Set default User-Agent.
|
||||
setUserAgent("Android-Java-Swagger");
|
||||
setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/android{{/httpUserAgent}}");
|
||||
}
|
||||
|
||||
public static void setUserAgent(String userAgent) {
|
||||
|
@ -185,7 +185,7 @@ public class ApiInvoker {
|
||||
|
||||
public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) {
|
||||
INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout);
|
||||
setUserAgent("Android-Volley-Swagger");
|
||||
setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/android{{/httpUserAgent}}");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
INSTANCE.authentications = new HashMap<String, Authentication>();
|
||||
|
@ -85,9 +85,6 @@ namespace {{packageName}}.Client
|
||||
{
|
||||
var request = new RestRequest(path, method);
|
||||
|
||||
// add user agent header
|
||||
request.AddHeader("User-Agent", Configuration.HttpUserAgent);
|
||||
|
||||
// add path parameter, if any
|
||||
foreach(var param in pathParams)
|
||||
request.AddParameter(param.Key, param.Value, ParameterType.UrlSegment);
|
||||
@ -146,6 +143,11 @@ namespace {{packageName}}.Client
|
||||
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||
pathParams, contentType);
|
||||
|
||||
// set timeout
|
||||
RestClient.Timeout = Configuration.Timeout;
|
||||
// set user agent
|
||||
RestClient.UserAgent = Configuration.UserAgent;
|
||||
|
||||
var response = RestClient.Execute(request);
|
||||
return (Object) response;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace {{packageName}}.Client
|
||||
string tempFolderPath = null,
|
||||
string dateTimeFormat = null,
|
||||
int timeout = 100000,
|
||||
string httpUserAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{packageVersion}}/csharp{{/httpUserAgent}}"
|
||||
string userAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{packageVersion}}/csharp{{/httpUserAgent}}"
|
||||
)
|
||||
{
|
||||
setApiClientUsingDefault(apiClient);
|
||||
@ -43,7 +43,7 @@ namespace {{packageName}}.Client
|
||||
Username = username;
|
||||
Password = password;
|
||||
AccessToken = accessToken;
|
||||
HttpUserAgent = httpUserAgent;
|
||||
UserAgent = userAgent;
|
||||
|
||||
if (defaultHeader != null)
|
||||
DefaultHeader = defaultHeader;
|
||||
@ -152,7 +152,7 @@ namespace {{packageName}}.Client
|
||||
/// Gets or sets the HTTP user agent.
|
||||
/// </summary>
|
||||
/// <value>Http user agent.</value>
|
||||
public String HttpUserAgent { get; set; }
|
||||
public String UserAgent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the username (HTTP basic authentication).
|
||||
|
@ -110,7 +110,7 @@ class Configuration
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $userAgent = "PHP-Swagger/{{artifactVersion}}";
|
||||
protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/php{{/httpUserAgent}}";
|
||||
|
||||
/**
|
||||
* Debug switch (default set to false)
|
||||
|
@ -81,7 +81,7 @@ class ApiClient(object):
|
||||
self.host = host
|
||||
self.cookie = cookie
|
||||
# Set default User-Agent.
|
||||
self.user_agent = 'Python-Swagger/{{packageVersion}}'
|
||||
self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/python{{/httpUserAgent}}'
|
||||
|
||||
@property
|
||||
def user_agent(self):
|
||||
|
@ -21,7 +21,7 @@ module {{moduleName}}
|
||||
|
||||
def initialize(config = Configuration.default)
|
||||
@config = config
|
||||
@user_agent = "ruby-swagger-#{VERSION}"
|
||||
@user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/#{VERSION}/ruby{{/httpUserAgent}}"
|
||||
@default_headers = {
|
||||
'Content-Type' => "application/json",
|
||||
'User-Agent' => @user_agent
|
||||
|
2
pom.xml
2
pom.xml
@ -549,7 +549,7 @@
|
||||
<swagger-parser-version>1.0.18-SNAPSHOT</swagger-parser-version>
|
||||
<scala-version>2.11.1</scala-version>
|
||||
<felix-version>2.3.4</felix-version>
|
||||
<swagger-core-version>1.5.7</swagger-core-version>
|
||||
<swagger-core-version>1.5.8</swagger-core-version>
|
||||
<commons-io-version>2.4</commons-io-version>
|
||||
<commons-cli-version>1.2</commons-cli-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
|
@ -83,7 +83,7 @@ public class ApiInvoker {
|
||||
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
|
||||
// Set default User-Agent.
|
||||
setUserAgent("Android-Java-Swagger");
|
||||
setUserAgent("Swagger-Codegen/1.0.0/android");
|
||||
}
|
||||
|
||||
public static void setUserAgent(String userAgent) {
|
||||
|
@ -185,25 +185,13 @@ public class ApiInvoker {
|
||||
|
||||
public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) {
|
||||
INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout);
|
||||
setUserAgent("Android-Volley-Swagger");
|
||||
setUserAgent("Swagger-Codegen/1.0.0/android");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
INSTANCE.authentications = new HashMap<String, Authentication>();
|
||||
|
||||
|
||||
|
||||
|
||||
INSTANCE.authentications.put("petstore_auth", new OAuth());
|
||||
|
||||
|
||||
|
||||
INSTANCE.authentications.put("test_api_client_id", new ApiKeyAuth("header", "x-test_api_client_id"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSTANCE.authentications.put("test_api_client_secret", new ApiKeyAuth("header", "x-test_api_client_secret"));
|
||||
INSTANCE.authentications.put("test_api_key_header", new ApiKeyAuth("header", "test_api_key_header"));
|
||||
|
||||
|
||||
|
||||
@ -215,15 +203,33 @@ public class ApiInvoker {
|
||||
|
||||
|
||||
|
||||
|
||||
INSTANCE.authentications.put("test_http_basic", new HttpBasicAuth());
|
||||
|
||||
|
||||
|
||||
|
||||
INSTANCE.authentications.put("test_api_client_secret", new ApiKeyAuth("header", "x-test_api_client_secret"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSTANCE.authentications.put("test_api_client_id", new ApiKeyAuth("header", "x-test_api_client_id"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSTANCE.authentications.put("test_api_key_query", new ApiKeyAuth("query", "test_api_key_query"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSTANCE.authentications.put("test_api_key_header", new ApiKeyAuth("header", "test_api_key_header"));
|
||||
|
||||
|
||||
INSTANCE.authentications.put("petstore_auth", new OAuth());
|
||||
|
||||
|
||||
// Prevent the authentications from being modified.
|
||||
|
@ -35,24 +35,40 @@ public class JsonUtil {
|
||||
public static Type getListTypeForDeserialization(Class cls) {
|
||||
String className = cls.getSimpleName();
|
||||
|
||||
if ("Category".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Category>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<InlineResponse200>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("ModelReturn".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<ModelReturn>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Name".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Name>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Order>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<User>>(){}.getType();
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Category".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Category>>(){}.getType();
|
||||
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<SpecialModelName>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Tag>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<User>>(){}.getType();
|
||||
}
|
||||
|
||||
return new TypeToken<List<Object>>(){}.getType();
|
||||
@ -61,26 +77,42 @@ public class JsonUtil {
|
||||
public static Type getTypeForDeserialization(Class cls) {
|
||||
String className = cls.getSimpleName();
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Order>(){}.getType();
|
||||
}
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<User>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Category".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Category>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Tag>(){}.getType();
|
||||
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<InlineResponse200>(){}.getType();
|
||||
}
|
||||
|
||||
if ("ModelReturn".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<ModelReturn>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Name".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Name>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Order>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Pet>(){}.getType();
|
||||
}
|
||||
|
||||
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<SpecialModelName>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Tag>(){}.getType();
|
||||
}
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<User>(){}.getType();
|
||||
}
|
||||
|
||||
return new TypeToken<Object>(){}.getType();
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -45,6 +45,147 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
public void deleteOrder (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder",
|
||||
new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public void deleteOrder (String orderId, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder",
|
||||
new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
@ -300,6 +441,285 @@ public class StoreApi {
|
||||
|
||||
|
||||
|
||||
} catch (ApiException exception) {
|
||||
errorListener.onErrorResponse(new VolleyError(exception));
|
||||
}
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
* Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
* @return Object
|
||||
*/
|
||||
public Object getInventoryInObject () throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "api_key" };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
* Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
|
||||
*/
|
||||
public void getInventoryInObject (final Response.Listener<Object> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "api_key" };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class));
|
||||
|
||||
|
||||
|
||||
} catch (ApiException exception) {
|
||||
errorListener.onErrorResponse(new VolleyError(exception));
|
||||
}
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return Order
|
||||
*/
|
||||
public Order getOrderById (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById",
|
||||
new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "test_api_key_header", "test_api_key_query" };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public void getOrderById (String orderId, final Response.Listener<Order> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById",
|
||||
new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "test_api_key_header", "test_api_key_query" };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class));
|
||||
|
||||
|
||||
|
||||
} catch (ApiException exception) {
|
||||
errorListener.onErrorResponse(new VolleyError(exception));
|
||||
}
|
||||
@ -450,291 +870,4 @@ public class StoreApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return Order
|
||||
*/
|
||||
public Order getOrderById (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById",
|
||||
new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public void getOrderById (String orderId, final Response.Listener<Order> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById",
|
||||
new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class));
|
||||
|
||||
|
||||
|
||||
} catch (ApiException exception) {
|
||||
errorListener.onErrorResponse(new VolleyError(exception));
|
||||
}
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
public void deleteOrder (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder",
|
||||
new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public void deleteOrder (String orderId, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder",
|
||||
new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -432,6 +432,293 @@ public class UserApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
public void deleteUser (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser",
|
||||
new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "test_http_basic" };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public void deleteUser (String username, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser",
|
||||
new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "test_http_basic" };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return User
|
||||
*/
|
||||
public User getUserByName (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName",
|
||||
new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return (User) ApiInvoker.deserialize(localVarResponse, "", User.class);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public void getUserByName (String username, final Response.Listener<User> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName",
|
||||
new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((User) ApiInvoker.deserialize(localVarResponse, "", User.class));
|
||||
|
||||
|
||||
|
||||
} catch (ApiException exception) {
|
||||
errorListener.onErrorResponse(new VolleyError(exception));
|
||||
}
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
@ -703,152 +990,6 @@ public class UserApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return User
|
||||
*/
|
||||
public User getUserByName (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName",
|
||||
new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return (User) ApiInvoker.deserialize(localVarResponse, "", User.class);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public void getUserByName (String username, final Response.Listener<User> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName",
|
||||
new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((User) ApiInvoker.deserialize(localVarResponse, "", User.class));
|
||||
|
||||
|
||||
|
||||
} catch (ApiException exception) {
|
||||
errorListener.onErrorResponse(new VolleyError(exception));
|
||||
}
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
@ -991,145 +1132,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
|
||||
* @return void
|
||||
*/
|
||||
public void deleteUser (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser",
|
||||
new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (ExecutionException ex) {
|
||||
if(ex.getCause() instanceof VolleyError) {
|
||||
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||
}
|
||||
throw ex;
|
||||
} catch (TimeoutException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public void deleteUser (String username, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser",
|
||||
new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"));
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String[] contentTypes = {
|
||||
|
||||
};
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
errorListener.onErrorResponse(new VolleyError(ex));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -85,9 +85,6 @@ namespace IO.Swagger.Client
|
||||
{
|
||||
var request = new RestRequest(path, method);
|
||||
|
||||
// add user agent header
|
||||
request.AddHeader("User-Agent", Configuration.HttpUserAgent);
|
||||
|
||||
// add path parameter, if any
|
||||
foreach(var param in pathParams)
|
||||
request.AddParameter(param.Key, param.Value, ParameterType.UrlSegment);
|
||||
@ -146,6 +143,11 @@ namespace IO.Swagger.Client
|
||||
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||
pathParams, contentType);
|
||||
|
||||
// set timeout
|
||||
RestClient.Timeout = Configuration.Timeout;
|
||||
// set user agent
|
||||
RestClient.UserAgent = Configuration.UserAgent;
|
||||
|
||||
var response = RestClient.Execute(request);
|
||||
return (Object) response;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace IO.Swagger.Client
|
||||
string tempFolderPath = null,
|
||||
string dateTimeFormat = null,
|
||||
int timeout = 100000,
|
||||
string httpUserAgent = "Swagger-Codegen/1.0.0/csharp"
|
||||
string userAgent = "Swagger-Codegen/1.0.0/csharp"
|
||||
)
|
||||
{
|
||||
setApiClientUsingDefault(apiClient);
|
||||
@ -43,7 +43,7 @@ namespace IO.Swagger.Client
|
||||
Username = username;
|
||||
Password = password;
|
||||
AccessToken = accessToken;
|
||||
HttpUserAgent = httpUserAgent;
|
||||
UserAgent = userAgent;
|
||||
|
||||
if (defaultHeader != null)
|
||||
DefaultHeader = defaultHeader;
|
||||
@ -152,7 +152,7 @@ namespace IO.Swagger.Client
|
||||
/// Gets or sets the HTTP user agent.
|
||||
/// </summary>
|
||||
/// <value>Http user agent.</value>
|
||||
public String HttpUserAgent { get; set; }
|
||||
public String UserAgent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the username (HTTP basic authentication).
|
||||
|
@ -2,13 +2,23 @@
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="TestPet.cs">
|
||||
<Files>
|
||||
<File FileName="TestPet.cs" Line="69" Column="32" />
|
||||
<File FileName="TestPet.cs" Line="139" Column="26" />
|
||||
<File FileName="TestOrder.cs" Line="1" Column="1" />
|
||||
</Files>
|
||||
<Pads>
|
||||
<Pad Id="MonoDevelop.NUnit.TestPad">
|
||||
<State name="__root__">
|
||||
<Node name="SwaggerClientTest" expanded="True" />
|
||||
<Node name="SwaggerClientTest" expanded="True">
|
||||
<Node name="SwaggerClientTest" expanded="True">
|
||||
<Node name="SwaggerClientTest" expanded="True">
|
||||
<Node name="TestPet" expanded="True">
|
||||
<Node name="TestPet" expanded="True">
|
||||
<Node name="TestGetPetById" selected="True" />
|
||||
</Node>
|
||||
</Node>
|
||||
</Node>
|
||||
</Node>
|
||||
</Node>
|
||||
</State>
|
||||
</Pad>
|
||||
</Pads>
|
||||
|
@ -136,7 +136,7 @@ namespace SwaggerClientTest.TestPet
|
||||
public void TestGetPetById ()
|
||||
{
|
||||
// set timeout to 10 seconds
|
||||
Configuration c1 = new Configuration (timeout: 10000);
|
||||
Configuration c1 = new Configuration (timeout: 10000, userAgent: "TEST_USER_AGENT");
|
||||
|
||||
PetApi petApi = new PetApi (c1);
|
||||
Pet response = petApi.GetPetById (petId);
|
||||
|
@ -1,9 +1,9 @@
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
|
||||
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll
|
||||
|
@ -3,7 +3,7 @@ package io.swagger.client;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private int code = 0;
|
||||
private Map<String, List<String>> responseHeaders = null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
private static ApiClient defaultApiClient = new ApiClient();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
private String name = "";
|
||||
private String value = "";
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -16,7 +16,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -194,7 +194,7 @@ public class UserApi {
|
||||
};
|
||||
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);
|
||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private final String location;
|
||||
private final String paramName;
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
|
||||
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 {
|
||||
private String username;
|
||||
private String password;
|
||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private String accessToken;
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
@ -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 {
|
||||
|
||||
private Integer _return = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Integer name = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long specialPropertyName = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -14,7 +14,7 @@ import feign.codec.EncodeException;
|
||||
import feign.codec.Encoder;
|
||||
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 static final String UTF_8 = "utf-8";
|
||||
private static final String LINE_FEED = "\r\n";
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -3,8 +3,8 @@ package io.swagger.client.api;
|
||||
import io.swagger.client.ApiClient;
|
||||
|
||||
import io.swagger.client.model.Pet;
|
||||
import java.io.File;
|
||||
import io.swagger.client.model.InlineResponse200;
|
||||
import java.io.File;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -12,23 +12,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
@ -42,6 +29,34 @@ public interface PetApi extends ApiClient.Api {
|
||||
})
|
||||
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
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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 'Find pet by ID'
|
||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
@ -153,16 +123,46 @@ public interface PetApi extends ApiClient.Api {
|
||||
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
|
||||
*/
|
||||
@RequestLine("POST /pet?testing_byte_array=true")
|
||||
@RequestLine("PUT /pet")
|
||||
@Headers({
|
||||
"Content-type: 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);
|
||||
|
||||
}
|
||||
|
@ -10,10 +10,23 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 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
|
||||
* A single status value can be provided as a string
|
||||
@ -51,19 +64,6 @@ public interface StoreApi extends ApiClient.Api {
|
||||
})
|
||||
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
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
@ -78,16 +78,16 @@ public interface StoreApi extends ApiClient.Api {
|
||||
Order getOrderById(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return void
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @return Order
|
||||
*/
|
||||
@RequestLine("DELETE /store/order/{orderId}")
|
||||
@RequestLine("POST /store/order")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accepts: application/json",
|
||||
})
|
||||
void deleteOrder(@Param("orderId") String orderId);
|
||||
Order placeOrder(Order body);
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
|
||||
|
||||
@ -53,6 +53,32 @@ public interface UserApi extends ApiClient.Api {
|
||||
})
|
||||
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
|
||||
*
|
||||
@ -79,19 +105,6 @@ public interface UserApi extends ApiClient.Api {
|
||||
})
|
||||
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
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -2,35 +2,62 @@ package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
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 {
|
||||
|
||||
private String name = null;
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
private Long id = 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) {
|
||||
this.name = name;
|
||||
public InlineResponse200 tags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "doggie", value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("tags")
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setTags(List<Tag> tags) {
|
||||
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
|
||||
public boolean equals(java.lang.Object o) {
|
||||
@ -78,14 +157,17 @@ public class InlineResponse200 {
|
||||
return false;
|
||||
}
|
||||
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.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
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, id, category);
|
||||
return Objects.hash(tags, id, category, status, name, photoUrls);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -93,9 +175,12 @@ public class InlineResponse200 {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineResponse200 {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -3,7 +3,7 @@ package io.swagger.client;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private int code = 0;
|
||||
private Map<String, List<String>> responseHeaders = null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
private static ApiClient defaultApiClient = new ApiClient();
|
||||
|
||||
|
@ -8,7 +8,7 @@ import java.text.DateFormat;
|
||||
|
||||
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> {
|
||||
private ObjectMapper mapper;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
private String name = "";
|
||||
private String value = "";
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -8,15 +8,15 @@ import io.swagger.client.Pair;
|
||||
import javax.ws.rs.core.GenericType;
|
||||
|
||||
import io.swagger.client.model.Pet;
|
||||
import java.io.File;
|
||||
import io.swagger.client.model.InlineResponse200;
|
||||
import java.io.File;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@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 {
|
||||
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
|
||||
*
|
||||
@ -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
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
@ -245,7 +294,7 @@ public class PetApi {
|
||||
};
|
||||
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>() {};
|
||||
@ -253,6 +302,142 @@ public class PetApi {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
* Returns a pet when ID < 10. ID > 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 'Find pet by ID'
|
||||
* Returns a pet when ID < 10. ID > 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
|
||||
*
|
||||
@ -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
|
||||
*
|
||||
@ -402,142 +538,6 @@ public class PetApi {
|
||||
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 'Find pet by ID'
|
||||
* Returns a pet when ID < 10. ID > 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 'Find pet by ID'
|
||||
* Returns a pet when ID < 10. ID > 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);
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -35,6 +35,52 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 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
|
||||
* 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 <= 5 or > 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
|
||||
*
|
||||
@ -203,98 +297,4 @@ public class StoreApi {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 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 < 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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 {
|
||||
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
|
||||
*
|
||||
@ -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
|
||||
* 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private final String location;
|
||||
private final String paramName;
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
|
||||
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 {
|
||||
private String username;
|
||||
private String password;
|
||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private String accessToken;
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -2,35 +2,62 @@ package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
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 {
|
||||
|
||||
private String name = null;
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
private Long id = 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) {
|
||||
this.name = name;
|
||||
public InlineResponse200 tags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "doggie", value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("tags")
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setTags(List<Tag> tags) {
|
||||
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
|
||||
public boolean equals(java.lang.Object o) {
|
||||
@ -78,14 +157,17 @@ public class InlineResponse200 {
|
||||
return false;
|
||||
}
|
||||
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.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
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, id, category);
|
||||
return Objects.hash(tags, id, category, status, name, photoUrls);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -93,9 +175,12 @@ public class InlineResponse200 {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineResponse200 {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -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 {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -3,7 +3,7 @@ package io.swagger.client;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private int code = 0;
|
||||
private Map<String, List<String>> responseHeaders = null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
private static ApiClient defaultApiClient = new ApiClient();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
private String name = "";
|
||||
private String value = "";
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 < 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 < 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 < 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 */
|
||||
private Call findOrdersByStatusCall(String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
@ -347,6 +451,114 @@ public class StoreApi {
|
||||
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 <= 5 or > 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 <= 5 or > 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 <= 5 or > 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 */
|
||||
private Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
@ -449,216 +661,4 @@ public class StoreApi {
|
||||
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 <= 5 or > 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 <= 5 or > 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 <= 5 or > 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 < 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 < 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 < 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -339,6 +339,218 @@ public class UserApi {
|
||||
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 */
|
||||
private Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
@ -543,114 +755,6 @@ public class UserApi {
|
||||
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 */
|
||||
private Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
@ -758,108 +862,4 @@ public class UserApi {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private final String location;
|
||||
private final String paramName;
|
||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private String accessToken;
|
||||
|
||||
|
@ -3,6 +3,9 @@ package io.swagger.client.model;
|
||||
import java.util.Objects;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.client.model.Tag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@ -12,8 +15,8 @@ import com.google.gson.annotations.SerializedName;
|
||||
@ApiModel(description = "")
|
||||
public class InlineResponse200 {
|
||||
|
||||
@SerializedName("name")
|
||||
private String name = null;
|
||||
@SerializedName("tags")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
@SerializedName("id")
|
||||
private Long id = null;
|
||||
@ -22,15 +25,47 @@ public class InlineResponse200 {
|
||||
private Object category = null;
|
||||
|
||||
|
||||
public enum StatusEnum {
|
||||
@SerializedName("available")
|
||||
AVAILABLE("available"),
|
||||
|
||||
@SerializedName("pending")
|
||||
PENDING("pending"),
|
||||
|
||||
@SerializedName("sold")
|
||||
SOLD("sold");
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("status")
|
||||
private StatusEnum status = null;
|
||||
|
||||
@SerializedName("name")
|
||||
private String name = null;
|
||||
|
||||
@SerializedName("photoUrls")
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
||||
@ -56,6 +91,40 @@ public class InlineResponse200 {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
@ -66,14 +135,17 @@ public class InlineResponse200 {
|
||||
return false;
|
||||
}
|
||||
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
|
||||
return Objects.equals(this.name, inlineResponse200.name) &&
|
||||
return Objects.equals(this.tags, inlineResponse200.tags) &&
|
||||
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
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, id, category);
|
||||
return Objects.hash(tags, id, category, status, name, photoUrls);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -81,9 +153,12 @@ public class InlineResponse200 {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineResponse200 {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.client;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:21.255+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:53.252+08:00")
|
||||
public class StringUtil {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -7,8 +7,8 @@ import retrofit.http.*;
|
||||
import retrofit.mime.*;
|
||||
|
||||
import io.swagger.client.model.Pet;
|
||||
import java.io.File;
|
||||
import io.swagger.client.model.InlineResponse200;
|
||||
import java.io.File;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -17,32 +17,6 @@ import java.util.Map;
|
||||
|
||||
public interface PetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* Sync method
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@PUT("/pet")
|
||||
Void updatePet(
|
||||
@Body Pet body
|
||||
);
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* Async method
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@PUT("/pet")
|
||||
void updatePet(
|
||||
@Body Pet body, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* Sync method
|
||||
@ -69,6 +43,60 @@ public interface PetApi {
|
||||
@Body Pet body, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
* Sync method
|
||||
*
|
||||
* @param body Pet object in the form of byte array
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@POST("/pet?testing_byte_array=true")
|
||||
Void addPetUsingByteArray(
|
||||
@Body byte[] body
|
||||
);
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
* Async method
|
||||
* @param body Pet object in the form of byte array
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@POST("/pet?testing_byte_array=true")
|
||||
void addPetUsingByteArray(
|
||||
@Body byte[] body, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* Sync method
|
||||
*
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@DELETE("/pet/{petId}")
|
||||
Void deletePet(
|
||||
@Path("petId") Long petId, @Header("api_key") String apiKey
|
||||
);
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* Async method
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@DELETE("/pet/{petId}")
|
||||
void deletePet(
|
||||
@Path("petId") Long petId, @Header("api_key") String apiKey, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Sync method
|
||||
@ -147,98 +175,6 @@ public interface PetApi {
|
||||
@Path("petId") Long petId, Callback<Pet> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* Sync method
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/pet/{petId}")
|
||||
Void updatePetWithForm(
|
||||
@Path("petId") String petId, @Field("name") String name, @Field("status") String status
|
||||
);
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* Async method
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/pet/{petId}")
|
||||
void updatePetWithForm(
|
||||
@Path("petId") String petId, @Field("name") String name, @Field("status") String status, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* Sync method
|
||||
*
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@DELETE("/pet/{petId}")
|
||||
Void deletePet(
|
||||
@Path("petId") Long petId, @Header("api_key") String apiKey
|
||||
);
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* Async method
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@DELETE("/pet/{petId}")
|
||||
void deletePet(
|
||||
@Path("petId") Long petId, @Header("api_key") String apiKey, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* Sync method
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@Multipart
|
||||
@POST("/pet/{petId}/uploadImage")
|
||||
Void uploadFile(
|
||||
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file
|
||||
);
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* Async method
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@Multipart
|
||||
@POST("/pet/{petId}/uploadImage")
|
||||
void uploadFile(
|
||||
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
* Sync method
|
||||
@ -292,29 +228,93 @@ public interface PetApi {
|
||||
);
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
* Update an existing pet
|
||||
* Sync method
|
||||
*
|
||||
* @param body Pet object in the form of byte array
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@POST("/pet?testing_byte_array=true")
|
||||
Void addPetUsingByteArray(
|
||||
@Body byte[] body
|
||||
@PUT("/pet")
|
||||
Void updatePet(
|
||||
@Body Pet body
|
||||
);
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
* Update an existing pet
|
||||
* Async method
|
||||
* @param body Pet object in the form of byte array
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@POST("/pet?testing_byte_array=true")
|
||||
void addPetUsingByteArray(
|
||||
@Body byte[] body, Callback<Void> cb
|
||||
@PUT("/pet")
|
||||
void updatePet(
|
||||
@Body Pet body, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* Sync method
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/pet/{petId}")
|
||||
Void updatePetWithForm(
|
||||
@Path("petId") String petId, @Field("name") String name, @Field("status") String status
|
||||
);
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* Async method
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/pet/{petId}")
|
||||
void updatePetWithForm(
|
||||
@Path("petId") String petId, @Field("name") String name, @Field("status") String status, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* Sync method
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@Multipart
|
||||
@POST("/pet/{petId}/uploadImage")
|
||||
Void uploadFile(
|
||||
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file
|
||||
);
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* Async method
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@Multipart
|
||||
@POST("/pet/{petId}/uploadImage")
|
||||
void uploadFile(
|
||||
@Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file, Callback<Void> cb
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,32 @@ import java.util.Map;
|
||||
|
||||
public interface StoreApi {
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* Sync method
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@DELETE("/store/order/{orderId}")
|
||||
Void deleteOrder(
|
||||
@Path("orderId") String orderId
|
||||
);
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* Async method
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@DELETE("/store/order/{orderId}")
|
||||
void deleteOrder(
|
||||
@Path("orderId") String orderId, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Finds orders by status
|
||||
* Sync method
|
||||
@ -87,32 +113,6 @@ public interface StoreApi {
|
||||
Callback<Object> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* Sync method
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @return Order
|
||||
*/
|
||||
|
||||
@POST("/store/order")
|
||||
Order placeOrder(
|
||||
@Body Order body
|
||||
);
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* Async method
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@POST("/store/order")
|
||||
void placeOrder(
|
||||
@Body Order body, Callback<Order> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* Sync method
|
||||
@ -140,29 +140,29 @@ public interface StoreApi {
|
||||
);
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* Place an order for a pet
|
||||
* Sync method
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return Void
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @return Order
|
||||
*/
|
||||
|
||||
@DELETE("/store/order/{orderId}")
|
||||
Void deleteOrder(
|
||||
@Path("orderId") String orderId
|
||||
@POST("/store/order")
|
||||
Order placeOrder(
|
||||
@Body Order body
|
||||
);
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* Place an order for a pet
|
||||
* Async method
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@DELETE("/store/order/{orderId}")
|
||||
void deleteOrder(
|
||||
@Path("orderId") String orderId, Callback<Void> cb
|
||||
@POST("/store/order")
|
||||
void placeOrder(
|
||||
@Body Order body, Callback<Order> cb
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -93,6 +93,58 @@ public interface UserApi {
|
||||
@Body List<User> body, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* Sync method
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@DELETE("/user/{username}")
|
||||
Void deleteUser(
|
||||
@Path("username") String username
|
||||
);
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* Async method
|
||||
* @param username The name that needs to be deleted
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@DELETE("/user/{username}")
|
||||
void deleteUser(
|
||||
@Path("username") String username, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* Sync method
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return User
|
||||
*/
|
||||
|
||||
@GET("/user/{username}")
|
||||
User getUserByName(
|
||||
@Path("username") String username
|
||||
);
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* Async method
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@GET("/user/{username}")
|
||||
void getUserByName(
|
||||
@Path("username") String username, Callback<User> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* Sync method
|
||||
@ -144,32 +196,6 @@ public interface UserApi {
|
||||
Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* Sync method
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return User
|
||||
*/
|
||||
|
||||
@GET("/user/{username}")
|
||||
User getUserByName(
|
||||
@Path("username") String username
|
||||
);
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* Async method
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@GET("/user/{username}")
|
||||
void getUserByName(
|
||||
@Path("username") String username, Callback<User> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* Sync method
|
||||
@ -198,30 +224,4 @@ public interface UserApi {
|
||||
@Path("username") String username, @Body User body, Callback<Void> cb
|
||||
);
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* Sync method
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@DELETE("/user/{username}")
|
||||
Void deleteUser(
|
||||
@Path("username") String username
|
||||
);
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* Async method
|
||||
* @param username The name that needs to be deleted
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@DELETE("/user/{username}")
|
||||
void deleteUser(
|
||||
@Path("username") String username, Callback<Void> cb
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,9 @@ package io.swagger.client.model;
|
||||
import java.util.Objects;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.client.model.Tag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@ -12,8 +15,8 @@ import com.google.gson.annotations.SerializedName;
|
||||
@ApiModel(description = "")
|
||||
public class InlineResponse200 {
|
||||
|
||||
@SerializedName("name")
|
||||
private String name = null;
|
||||
@SerializedName("tags")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
@SerializedName("id")
|
||||
private Long id = null;
|
||||
@ -22,15 +25,47 @@ public class InlineResponse200 {
|
||||
private Object category = null;
|
||||
|
||||
|
||||
public enum StatusEnum {
|
||||
@SerializedName("available")
|
||||
AVAILABLE("available"),
|
||||
|
||||
@SerializedName("pending")
|
||||
PENDING("pending"),
|
||||
|
||||
@SerializedName("sold")
|
||||
SOLD("sold");
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("status")
|
||||
private StatusEnum status = null;
|
||||
|
||||
@SerializedName("name")
|
||||
private String name = null;
|
||||
|
||||
@SerializedName("photoUrls")
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
||||
@ -56,6 +91,40 @@ public class InlineResponse200 {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
@ -66,14 +135,17 @@ public class InlineResponse200 {
|
||||
return false;
|
||||
}
|
||||
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
|
||||
return Objects.equals(name, inlineResponse200.name) &&
|
||||
return Objects.equals(tags, inlineResponse200.tags) &&
|
||||
Objects.equals(id, inlineResponse200.id) &&
|
||||
Objects.equals(category, inlineResponse200.category);
|
||||
Objects.equals(category, inlineResponse200.category) &&
|
||||
Objects.equals(status, inlineResponse200.status) &&
|
||||
Objects.equals(name, inlineResponse200.name) &&
|
||||
Objects.equals(photoUrls, inlineResponse200.photoUrls);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, id, category);
|
||||
return Objects.hash(tags, id, category, status, name, photoUrls);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -81,9 +153,12 @@ public class InlineResponse200 {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineResponse200 {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -9,8 +9,8 @@ import retrofit2.http.*;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import io.swagger.client.model.Pet;
|
||||
import java.io.File;
|
||||
import io.swagger.client.model.InlineResponse200;
|
||||
import java.io.File;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -19,19 +19,6 @@ import java.util.Map;
|
||||
|
||||
public interface PetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @return Call<Void>
|
||||
*/
|
||||
|
||||
@PUT("pet")
|
||||
Call<Void> updatePet(
|
||||
@Body Pet body
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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 'Find pet by ID'
|
||||
* Returns a pet when ID < 10. ID > 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>
|
||||
*/
|
||||
|
||||
@POST("pet?testing_byte_array=true")
|
||||
Call<Void> addPetUsingByteArray(
|
||||
@Body byte[] body
|
||||
@PUT("pet")
|
||||
Call<Void> updatePet(
|
||||
@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
|
||||
);
|
||||
|
||||
|
||||
|
@ -17,6 +17,19 @@ import java.util.Map;
|
||||
|
||||
public interface StoreApi {
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 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
|
||||
* 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
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
@ -79,15 +79,15 @@ public interface StoreApi {
|
||||
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return Call<Void>
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @return Call<Order>
|
||||
*/
|
||||
|
||||
@DELETE("store/order/{orderId}")
|
||||
Call<Void> deleteOrder(
|
||||
@Path("orderId") String orderId
|
||||
@POST("store/order")
|
||||
Call<Order> placeOrder(
|
||||
@Body Order body
|
||||
);
|
||||
|
||||
|
||||
|
@ -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
|
||||
*
|
||||
@ -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
|
||||
* 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
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
@ -15,11 +15,8 @@ import com.google.gson.annotations.SerializedName;
|
||||
@ApiModel(description = "")
|
||||
public class InlineResponse200 {
|
||||
|
||||
@SerializedName("photoUrls")
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
@SerializedName("name")
|
||||
private String name = null;
|
||||
@SerializedName("tags")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
@SerializedName("id")
|
||||
private Long id = null;
|
||||
@ -27,9 +24,6 @@ public class InlineResponse200 {
|
||||
@SerializedName("category")
|
||||
private Object category = null;
|
||||
|
||||
@SerializedName("tags")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
|
||||
public enum StatusEnum {
|
||||
@SerializedName("available")
|
||||
@ -56,27 +50,22 @@ public enum StatusEnum {
|
||||
@SerializedName("status")
|
||||
private StatusEnum status = null;
|
||||
|
||||
@SerializedName("name")
|
||||
private String name = null;
|
||||
|
||||
@SerializedName("photoUrls")
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
**/
|
||||
@ -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
|
||||
public boolean equals(Object o) {
|
||||
@ -135,17 +135,17 @@ public enum StatusEnum {
|
||||
return false;
|
||||
}
|
||||
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
|
||||
return Objects.equals(photoUrls, inlineResponse200.photoUrls) &&
|
||||
Objects.equals(name, inlineResponse200.name) &&
|
||||
return Objects.equals(tags, inlineResponse200.tags) &&
|
||||
Objects.equals(id, inlineResponse200.id) &&
|
||||
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
|
||||
public int hashCode() {
|
||||
return Objects.hash(photoUrls, name, id, category, tags, status);
|
||||
return Objects.hash(tags, id, category, status, name, photoUrls);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -153,12 +153,12 @@ public enum StatusEnum {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineResponse200 {\n");
|
||||
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -397,6 +397,11 @@ class UserApi
|
||||
$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
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
|
@ -110,7 +110,7 @@ class Configuration
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $userAgent = "PHP-Swagger/1.0.0";
|
||||
protected $userAgent = "Swagger-Codegen/1.0.0/php";
|
||||
|
||||
/**
|
||||
* Debug switch (default set to false)
|
||||
|
@ -81,7 +81,7 @@ class ApiClient(object):
|
||||
self.host = host
|
||||
self.cookie = cookie
|
||||
# Set default User-Agent.
|
||||
self.user_agent = 'Python-Swagger/1.0.0'
|
||||
self.user_agent = 'Swagger-Codegen/1.0.0/python'
|
||||
|
||||
@property
|
||||
def user_agent(self):
|
||||
|
@ -330,7 +330,7 @@ class UserApi(object):
|
||||
select_header_content_type([])
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = []
|
||||
auth_settings = ['test_http_basic']
|
||||
|
||||
response = self.api_client.call_api(resource_path, 'DELETE',
|
||||
path_params,
|
||||
|
@ -231,6 +231,13 @@ class Configuration(object):
|
||||
'key': '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':
|
||||
{
|
||||
'type': 'api_key',
|
||||
|
@ -6,7 +6,7 @@ Version: 1.0.0
|
||||
|
||||
Automatically generated by the Ruby Swagger Codegen project:
|
||||
|
||||
- Build date: 2016-03-14T15:33:44.953+08:00
|
||||
- Build date: 2016-03-14T21:56:19.858+08:00
|
||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
@ -119,25 +119,10 @@ Class | Method | HTTP request | Description
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
-- write:pets: modify pets in your account
|
||||
-- read:pets: read your pets
|
||||
|
||||
### test_api_client_id
|
||||
### test_api_key_header
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_id
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_api_client_secret
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_secret
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
|
||||
### api_key
|
||||
@ -150,15 +135,30 @@ Class | Method | HTTP request | Description
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### test_api_client_secret
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_secret
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_api_client_id
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_id
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
### test_api_key_header
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
-- write:pets: modify pets in your account
|
||||
-- read:pets: read your pets
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user