mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
Merge branch 'default-value-comment' of https://github.com/xhh/swagger-codegen into xhh-default-value-comment
Conflicts: modules/swagger-codegen/src/main/resources/Javascript/api.mustache
This commit is contained in:
commit
8ebe20dfd5
@ -42,7 +42,7 @@ public class {{classname}} {
|
||||
/**
|
||||
* {{summary}}
|
||||
* {{notes}}{{#allParams}}
|
||||
* @param {{paramName}} {{description}}{{/allParams}}{{#returnType}}
|
||||
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}}
|
||||
* @return {{{returnType}}}{{/returnType}}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ public class {{classname}} {
|
||||
/**
|
||||
* {{summary}}
|
||||
* {{notes}}{{#allParams}}
|
||||
* @param {{paramName}} {{description}}{{/allParams}}{{#returnType}}
|
||||
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}}
|
||||
* @return {{{returnType}}}{{/returnType}}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
|
@ -106,7 +106,7 @@ public class {{classname}} {
|
||||
/**
|
||||
* {{summary}}
|
||||
* {{notes}}{{#allParams}}
|
||||
* @param {{paramName}} {{description}}{{/allParams}}{{#returnType}}
|
||||
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}}
|
||||
* @return {{{returnType}}}{{/returnType}}
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -118,7 +118,7 @@ public class {{classname}} {
|
||||
/**
|
||||
* {{summary}}
|
||||
* {{notes}}{{#allParams}}
|
||||
* @param {{paramName}} {{description}}{{/allParams}}
|
||||
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}
|
||||
* @return ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -131,7 +131,7 @@ public class {{classname}} {
|
||||
/**
|
||||
* {{summary}} (asynchronously)
|
||||
* {{notes}}{{#allParams}}
|
||||
* @param {{paramName}} {{description}}{{/allParams}}
|
||||
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}
|
||||
* @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
|
||||
|
@ -18,7 +18,7 @@ module {{moduleName}}
|
||||
# {{notes}}
|
||||
{{#allParams}}{{#required}} # @param {{paramName}} {{description}}
|
||||
{{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
|
||||
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}
|
||||
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||
{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}]
|
||||
def {{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
|
||||
{{#returnType}}data, status_code, headers = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts)
|
||||
|
@ -41,7 +41,7 @@ import io.swagger.client.auth.HttpBasicAuth;
|
||||
import io.swagger.client.auth.ApiKeyAuth;
|
||||
import io.swagger.client.auth.OAuth;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-18T20:04:40.386+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T15:55:38.841+08:00")
|
||||
public class ApiClient {
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
private String basePath = "http://petstore.swagger.io/v2";
|
||||
@ -71,7 +71,7 @@ public class ApiClient {
|
||||
dateFormat = ApiClient.buildDefaultDateFormat();
|
||||
|
||||
// Set default User-Agent.
|
||||
setUserAgent("Java-Swagger");
|
||||
setUserAgent("Swagger-Codegen/1.0.0/java");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
@ -79,6 +79,7 @@ public class ApiClient {
|
||||
authentications.put("test_api_client_id", new ApiKeyAuth("header", "x-test_api_client_id"));
|
||||
authentications.put("test_api_client_secret", new ApiKeyAuth("header", "x-test_api_client_secret"));
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("test_http_basic", new HttpBasicAuth());
|
||||
authentications.put("test_api_key_query", new ApiKeyAuth("query", "test_api_key_query"));
|
||||
authentications.put("test_api_key_header", new ApiKeyAuth("header", "test_api_key_header"));
|
||||
// Prevent the authentications from being modified.
|
||||
|
@ -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-17T10:45:51.189+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:01:11.428+08:00")
|
||||
public class PetApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -40,7 +40,7 @@ public class PetApi {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void addPet(Pet body) throws ApiException {
|
||||
@ -80,7 +80,7 @@ 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
|
||||
* @param body Pet object in the form of byte array (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
||||
@ -120,8 +120,8 @@ public class PetApi {
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||
@ -169,7 +169,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @param status Status values that need to be considered for query (optional, default to available)
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -213,7 +213,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by
|
||||
* @param tags Tags to filter by (optional)
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -257,7 +257,7 @@ public class PetApi {
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return Pet
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -294,7 +294,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
|
||||
|
||||
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||
@ -305,7 +305,7 @@ 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return InlineResponse200
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -342,7 +342,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
|
||||
|
||||
GenericType<InlineResponse200> localVarReturnType = new GenericType<InlineResponse200>() {};
|
||||
@ -353,7 +353,7 @@ public class PetApi {
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return byte[]
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -390,7 +390,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
|
||||
|
||||
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
||||
@ -401,7 +401,7 @@ public class PetApi {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePet(Pet body) throws ApiException {
|
||||
@ -441,9 +441,9 @@ public class PetApi {
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
||||
@ -493,9 +493,9 @@ public class PetApi {
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
|
@ -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-17T10:45:51.189+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:01:11.428+08:00")
|
||||
public class StoreApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -38,7 +38,7 @@ 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
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteOrder(String orderId) throws ApiException {
|
||||
@ -84,7 +84,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
* @param status Status value that needs to be considered for query
|
||||
* @param status Status value that needs to be considered for query (optional, default to placed)
|
||||
* @return List<Order>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -210,7 +210,7 @@ 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
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -247,7 +247,7 @@ public class StoreApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "test_api_key_header", "test_api_key_query" };
|
||||
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||
|
||||
|
||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||
@ -258,7 +258,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param body order placed for purchasing the pet (optional)
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
|
@ -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-17T10:45:51.189+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:01:11.428+08:00")
|
||||
public class UserApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -38,7 +38,7 @@ public class UserApi {
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object
|
||||
* @param body Created user object (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUser(User body) throws ApiException {
|
||||
@ -78,7 +78,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||
@ -118,7 +118,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||
@ -158,7 +158,7 @@ public class UserApi {
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteUser(String username) throws ApiException {
|
||||
@ -204,7 +204,7 @@ public class UserApi {
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return User
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -252,8 +252,8 @@ public class UserApi {
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @param username The user name for login (optional)
|
||||
* @param password The password for login in clear text (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -338,8 +338,8 @@ public class UserApi {
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param body Updated user object (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updateUser(String username, User body) throws ApiException {
|
||||
|
@ -112,21 +112,25 @@ public class ApiClientTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetUsername() {
|
||||
try {
|
||||
apiClient.setUsername("my-username");
|
||||
fail("there should be no HTTP basic authentications");
|
||||
} catch (RuntimeException e) {
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof HttpBasicAuth) {
|
||||
auth = (HttpBasicAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
|
||||
@Test
|
||||
public void testSetPassword() {
|
||||
try {
|
||||
apiClient.setPassword("my-password");
|
||||
fail("there should be no HTTP basic authentications");
|
||||
} catch (RuntimeException e) {
|
||||
}
|
||||
apiClient.setUsername("my-username");
|
||||
apiClient.setPassword("my-password");
|
||||
assertEquals("my-username", auth.getUsername());
|
||||
assertEquals("my-password", auth.getPassword());
|
||||
|
||||
// reset values
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
12
samples/client/petstore/java/jersey2/.gitignore
vendored
Normal file
12
samples/client/petstore/java/jersey2/.gitignore
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
*.class
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
52
samples/client/petstore/java/jersey2/git_push.sh
Normal file
52
samples/client/petstore/java/jersey2/git_push.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="YOUR_GIT_USR_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="YOUR_GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
||||
|
@ -48,7 +48,7 @@ import io.swagger.client.auth.HttpBasicAuth;
|
||||
import io.swagger.client.auth.ApiKeyAuth;
|
||||
import io.swagger.client.auth.OAuth;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:21.885+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T17:22:31.147+08:00")
|
||||
public class ApiClient {
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
private String basePath = "http://petstore.swagger.io/v2";
|
||||
@ -80,7 +80,7 @@ public class ApiClient {
|
||||
this.json.setDateFormat((DateFormat) dateFormat.clone());
|
||||
|
||||
// Set default User-Agent.
|
||||
setUserAgent("Java-Swagger");
|
||||
setUserAgent("Swagger-Codegen/1.0.0/java");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
@ -88,6 +88,7 @@ public class ApiClient {
|
||||
authentications.put("test_api_client_id", new ApiKeyAuth("header", "x-test_api_client_id"));
|
||||
authentications.put("test_api_client_secret", new ApiKeyAuth("header", "x-test_api_client_secret"));
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("test_http_basic", new HttpBasicAuth());
|
||||
authentications.put("test_api_key_query", new ApiKeyAuth("query", "test_api_key_query"));
|
||||
authentications.put("test_api_key_header", new ApiKeyAuth("header", "test_api_key_header"));
|
||||
// Prevent the authentications from being modified.
|
||||
|
@ -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-14T22:17:48.808+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:00:50.657+08:00")
|
||||
public class PetApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -40,7 +40,7 @@ public class PetApi {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void addPet(Pet body) throws ApiException {
|
||||
@ -80,7 +80,7 @@ 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
|
||||
* @param body Pet object in the form of byte array (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
||||
@ -120,8 +120,8 @@ public class PetApi {
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||
@ -169,7 +169,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @param status Status values that need to be considered for query (optional, default to available)
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -213,7 +213,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by
|
||||
* @param tags Tags to filter by (optional)
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -257,7 +257,7 @@ public class PetApi {
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return Pet
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -294,7 +294,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
|
||||
|
||||
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||
@ -305,7 +305,7 @@ 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return InlineResponse200
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -342,7 +342,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
|
||||
|
||||
GenericType<InlineResponse200> localVarReturnType = new GenericType<InlineResponse200>() {};
|
||||
@ -353,7 +353,7 @@ public class PetApi {
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return byte[]
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -390,7 +390,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
|
||||
|
||||
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
||||
@ -401,7 +401,7 @@ public class PetApi {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePet(Pet body) throws ApiException {
|
||||
@ -441,9 +441,9 @@ public class PetApi {
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
||||
@ -493,9 +493,9 @@ public class PetApi {
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
|
@ -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-14T22:17:48.808+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:00:50.657+08:00")
|
||||
public class StoreApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -38,7 +38,7 @@ 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
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteOrder(String orderId) throws ApiException {
|
||||
@ -84,7 +84,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
* @param status Status value that needs to be considered for query
|
||||
* @param status Status value that needs to be considered for query (optional, default to placed)
|
||||
* @return List<Order>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -210,7 +210,7 @@ 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
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -247,7 +247,7 @@ public class StoreApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "test_api_key_header", "test_api_key_query" };
|
||||
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||
|
||||
|
||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||
@ -258,7 +258,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param body order placed for purchasing the pet (optional)
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
|
@ -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-14T22:17:48.808+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:00:50.657+08:00")
|
||||
public class UserApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -38,7 +38,7 @@ public class UserApi {
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object
|
||||
* @param body Created user object (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUser(User body) throws ApiException {
|
||||
@ -78,7 +78,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||
@ -118,7 +118,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||
@ -158,7 +158,7 @@ public class UserApi {
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteUser(String username) throws ApiException {
|
||||
@ -204,7 +204,7 @@ public class UserApi {
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return User
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -252,8 +252,8 @@ public class UserApi {
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @param username The user name for login (optional)
|
||||
* @param password The password for login in clear text (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
@ -338,8 +338,8 @@ public class UserApi {
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param body Updated user object (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updateUser(String username, User body) throws ApiException {
|
||||
|
@ -0,0 +1,74 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:00:50.657+08:00")
|
||||
public class Model200Response {
|
||||
|
||||
private Integer name = null;
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
public Model200Response name(Integer name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name")
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Model200Response _200Response = (Model200Response) o;
|
||||
return Objects.equals(this.name, _200Response.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Model200Response {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,74 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:00:50.657+08:00")
|
||||
public class ModelReturn {
|
||||
|
||||
private Integer _return = null;
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
public ModelReturn _return(Integer _return) {
|
||||
this._return = _return;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("return")
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
public void setReturn(Integer _return) {
|
||||
this._return = _return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelReturn _return = (ModelReturn) o;
|
||||
return Objects.equals(this._return, _return._return);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_return);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelReturn {\n");
|
||||
|
||||
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,74 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:00:50.657+08:00")
|
||||
public class Name {
|
||||
|
||||
private Integer name = null;
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
public Name name(Integer name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name")
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Name name = (Name) o;
|
||||
return Objects.equals(this.name, name.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Name {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,74 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-17T16:00:50.657+08:00")
|
||||
public class SpecialModelName {
|
||||
|
||||
private Long specialPropertyName = null;
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
public SpecialModelName specialPropertyName(Long specialPropertyName) {
|
||||
this.specialPropertyName = specialPropertyName;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("$special[property.name]")
|
||||
public Long getSpecialPropertyName() {
|
||||
return specialPropertyName;
|
||||
}
|
||||
public void setSpecialPropertyName(Long specialPropertyName) {
|
||||
this.specialPropertyName = specialPropertyName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SpecialModelName specialModelName = (SpecialModelName) o;
|
||||
return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(specialPropertyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SpecialModelName {\n");
|
||||
|
||||
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -112,21 +112,25 @@ public class ApiClientTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetUsername() {
|
||||
try {
|
||||
apiClient.setUsername("my-username");
|
||||
fail("there should be no HTTP basic authentications");
|
||||
} catch (RuntimeException e) {
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof HttpBasicAuth) {
|
||||
auth = (HttpBasicAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
|
||||
@Test
|
||||
public void testSetPassword() {
|
||||
try {
|
||||
apiClient.setPassword("my-password");
|
||||
fail("there should be no HTTP basic authentications");
|
||||
} catch (RuntimeException e) {
|
||||
}
|
||||
apiClient.setUsername("my-username");
|
||||
apiClient.setPassword("my-password");
|
||||
assertEquals("my-username", auth.getUsername());
|
||||
assertEquals("my-password", auth.getPassword());
|
||||
|
||||
// reset values
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
12
samples/client/petstore/java/okhttp-gson/.gitignore
vendored
Normal file
12
samples/client/petstore/java/okhttp-gson/.gitignore
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
*.class
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
52
samples/client/petstore/java/okhttp-gson/git_push.sh
Normal file
52
samples/client/petstore/java/okhttp-gson/git_push.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="YOUR_GIT_USR_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="YOUR_GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
||||
|
@ -141,7 +141,7 @@ public class ApiClient {
|
||||
this.lenientDatetimeFormat = true;
|
||||
|
||||
// Set default User-Agent.
|
||||
setUserAgent("Java-Swagger");
|
||||
setUserAgent("Swagger-Codegen/1.0.0/java");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
@ -149,6 +149,7 @@ public class ApiClient {
|
||||
authentications.put("test_api_client_id", new ApiKeyAuth("header", "x-test_api_client_id"));
|
||||
authentications.put("test_api_client_secret", new ApiKeyAuth("header", "x-test_api_client_secret"));
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("test_http_basic", new HttpBasicAuth());
|
||||
authentications.put("test_api_key_query", new ApiKeyAuth("query", "test_api_key_query"));
|
||||
authentications.put("test_api_key_header", new ApiKeyAuth("header", "test_api_key_header"));
|
||||
// Prevent the authentications from being modified.
|
||||
|
@ -92,7 +92,7 @@ public class PetApi {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void addPet(Pet body) throws ApiException {
|
||||
@ -102,7 +102,7 @@ public class PetApi {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -114,7 +114,7 @@ public class PetApi {
|
||||
/**
|
||||
* Add a new pet to the store (asynchronously)
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @param 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
|
||||
@ -190,7 +190,7 @@ 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
|
||||
* @param body Pet object in the form of byte array (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
||||
@ -200,7 +200,7 @@ 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
|
||||
* @param body Pet object in the form of byte array (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -212,7 +212,7 @@ public class PetApi {
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store (asynchronously)
|
||||
*
|
||||
* @param body Pet object in the form of byte array
|
||||
* @param body Pet object in the form of byte array (optional)
|
||||
* @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
|
||||
@ -296,8 +296,8 @@ public class PetApi {
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||
@ -307,8 +307,8 @@ public class PetApi {
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -320,8 +320,8 @@ public class PetApi {
|
||||
/**
|
||||
* Deletes a pet (asynchronously)
|
||||
*
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @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
|
||||
@ -399,7 +399,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @param status Status values that need to be considered for query (optional, default to available)
|
||||
* @return List<Pet>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -411,7 +411,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @param status Status values that need to be considered for query (optional, default to available)
|
||||
* @return ApiResponse<List<Pet>>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -424,7 +424,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by status (asynchronously)
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @param status Status values that need to be considered for query (optional, default to available)
|
||||
* @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
|
||||
@ -503,7 +503,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by
|
||||
* @param tags Tags to filter by (optional)
|
||||
* @return List<Pet>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -515,7 +515,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by
|
||||
* @param tags Tags to filter by (optional)
|
||||
* @return ApiResponse<List<Pet>>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -528,7 +528,7 @@ public class PetApi {
|
||||
/**
|
||||
* Finds Pets by tags (asynchronously)
|
||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by
|
||||
* @param tags Tags to filter by (optional)
|
||||
* @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
|
||||
@ -604,14 +604,14 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return Pet
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -623,7 +623,7 @@ public class PetApi {
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return ApiResponse<Pet>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -636,7 +636,7 @@ public class PetApi {
|
||||
/**
|
||||
* Find pet by ID (asynchronously)
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @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
|
||||
@ -712,14 +712,14 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return InlineResponse200
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -731,7 +731,7 @@ 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return ApiResponse<InlineResponse200>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -744,7 +744,7 @@ public class PetApi {
|
||||
/**
|
||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID' (asynchronously)
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @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
|
||||
@ -820,14 +820,14 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return byte[]
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -839,7 +839,7 @@ public class PetApi {
|
||||
/**
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @return ApiResponse<byte[]>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -852,7 +852,7 @@ public class PetApi {
|
||||
/**
|
||||
* Fake endpoint to test byte array return by 'Find pet by ID' (asynchronously)
|
||||
* 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
|
||||
* @param petId ID of pet that needs to be fetched (required)
|
||||
* @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
|
||||
@ -929,7 +929,7 @@ public class PetApi {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void updatePet(Pet body) throws ApiException {
|
||||
@ -939,7 +939,7 @@ public class PetApi {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -951,7 +951,7 @@ public class PetApi {
|
||||
/**
|
||||
* Update an existing pet (asynchronously)
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param body Pet object that needs to be added to the store (optional)
|
||||
* @param 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
|
||||
@ -1037,9 +1037,9 @@ public class PetApi {
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
||||
@ -1049,9 +1049,9 @@ public class PetApi {
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -1063,9 +1063,9 @@ public class PetApi {
|
||||
/**
|
||||
* Updates a pet in the store with form data (asynchronously)
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @param 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
|
||||
@ -1151,9 +1151,9 @@ public class PetApi {
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
@ -1163,9 +1163,9 @@ public class PetApi {
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -1177,9 +1177,9 @@ public class PetApi {
|
||||
/**
|
||||
* uploads an image (asynchronously)
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param 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
|
||||
|
@ -96,7 +96,7 @@ 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
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @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 {
|
||||
@ -106,7 +106,7 @@ 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
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -118,7 +118,7 @@ public class StoreApi {
|
||||
/**
|
||||
* 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 orderId ID of the order that needs to be deleted (required)
|
||||
* @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
|
||||
@ -196,7 +196,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
* @param status Status value that needs to be considered for query
|
||||
* @param status Status value that needs to be considered for query (optional, default to placed)
|
||||
* @return List<Order>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -208,7 +208,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
* @param status Status value that needs to be considered for query
|
||||
* @param status Status value that needs to be considered for query (optional, default to placed)
|
||||
* @return ApiResponse<List<Order>>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -221,7 +221,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Finds orders by status (asynchronously)
|
||||
* A single status value can be provided as a string
|
||||
* @param status Status value that needs to be considered for query
|
||||
* @param status Status value that needs to be considered for query (optional, default to placed)
|
||||
* @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
|
||||
@ -495,14 +495,14 @@ public class StoreApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { "test_api_key_header", "test_api_key_query" };
|
||||
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
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @return Order
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -514,7 +514,7 @@ 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
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @return ApiResponse<Order>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -527,7 +527,7 @@ public class StoreApi {
|
||||
/**
|
||||
* 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 orderId ID of pet that needs to be fetched (required)
|
||||
* @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
|
||||
@ -604,7 +604,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param body order placed for purchasing the pet (optional)
|
||||
* @return Order
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -616,7 +616,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param body order placed for purchasing the pet (optional)
|
||||
* @return ApiResponse<Order>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -629,7 +629,7 @@ public class StoreApi {
|
||||
/**
|
||||
* Place an order for a pet (asynchronously)
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param body order placed for purchasing the pet (optional)
|
||||
* @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
|
||||
|
@ -90,7 +90,7 @@ public class UserApi {
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object
|
||||
* @param body Created user object (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void createUser(User body) throws ApiException {
|
||||
@ -100,7 +100,7 @@ public class UserApi {
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object
|
||||
* @param body Created user object (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -112,7 +112,7 @@ public class UserApi {
|
||||
/**
|
||||
* Create user (asynchronously)
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object
|
||||
* @param body Created user object (optional)
|
||||
* @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
|
||||
@ -188,7 +188,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||
@ -198,7 +198,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -210,7 +210,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array (asynchronously)
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @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
|
||||
@ -286,7 +286,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||
@ -296,7 +296,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -308,7 +308,7 @@ public class UserApi {
|
||||
/**
|
||||
* Creates list of users with given input array (asynchronously)
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param body List of user object (optional)
|
||||
* @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
|
||||
@ -390,7 +390,7 @@ public class UserApi {
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @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 {
|
||||
@ -400,7 +400,7 @@ public class UserApi {
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -412,7 +412,7 @@ public class UserApi {
|
||||
/**
|
||||
* Delete user (asynchronously)
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @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
|
||||
@ -494,7 +494,7 @@ public class UserApi {
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return User
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -506,7 +506,7 @@ public class UserApi {
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return ApiResponse<User>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -519,7 +519,7 @@ public class UserApi {
|
||||
/**
|
||||
* Get user by user name (asynchronously)
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @param 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
|
||||
@ -600,8 +600,8 @@ public class UserApi {
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @param username The user name for login (optional)
|
||||
* @param password The password for login in clear text (optional)
|
||||
* @return String
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -613,8 +613,8 @@ public class UserApi {
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @param username The user name for login (optional)
|
||||
* @param password The password for login in clear text (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -627,8 +627,8 @@ public class UserApi {
|
||||
/**
|
||||
* Logs user into the system (asynchronously)
|
||||
*
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @param username The user name for login (optional)
|
||||
* @param password The password for login in clear text (optional)
|
||||
* @param 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
|
||||
@ -806,8 +806,8 @@ public class UserApi {
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param body Updated user object (optional)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void updateUser(String username, User body) throws ApiException {
|
||||
@ -817,8 +817,8 @@ public class UserApi {
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param body Updated user object (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
@ -830,8 +830,8 @@ public class UserApi {
|
||||
/**
|
||||
* Updated user (asynchronously)
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param body Updated user object (optional)
|
||||
* @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
|
||||
|
@ -9,7 +9,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
|
||||
public class Category {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -12,11 +12,14 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
|
||||
public class InlineResponse200 {
|
||||
|
||||
@SerializedName("tags")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
@SerializedName("photoUrls")
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
@SerializedName("name")
|
||||
private String name = null;
|
||||
|
||||
@SerializedName("id")
|
||||
private Long id = null;
|
||||
@ -24,6 +27,9 @@ public class InlineResponse200 {
|
||||
@SerializedName("category")
|
||||
private Object category = null;
|
||||
|
||||
@SerializedName("tags")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
|
||||
public enum StatusEnum {
|
||||
@SerializedName("available")
|
||||
@ -50,22 +56,27 @@ public enum StatusEnum {
|
||||
@SerializedName("status")
|
||||
private StatusEnum status = null;
|
||||
|
||||
@SerializedName("name")
|
||||
private String name = null;
|
||||
|
||||
@SerializedName("photoUrls")
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@ -91,6 +102,17 @@ public enum StatusEnum {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
**/
|
||||
@ -103,28 +125,6 @@ public enum StatusEnum {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
@ -135,17 +135,17 @@ public enum StatusEnum {
|
||||
return false;
|
||||
}
|
||||
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
|
||||
return Objects.equals(this.tags, inlineResponse200.tags) &&
|
||||
return Objects.equals(this.photoUrls, inlineResponse200.photoUrls) &&
|
||||
Objects.equals(this.name, inlineResponse200.name) &&
|
||||
Objects.equals(this.id, inlineResponse200.id) &&
|
||||
Objects.equals(this.category, inlineResponse200.category) &&
|
||||
Objects.equals(this.status, inlineResponse200.status) &&
|
||||
Objects.equals(this.name, inlineResponse200.name) &&
|
||||
Objects.equals(this.photoUrls, inlineResponse200.photoUrls);
|
||||
Objects.equals(this.tags, inlineResponse200.tags) &&
|
||||
Objects.equals(this.status, inlineResponse200.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(tags, id, category, status, name, photoUrls);
|
||||
return Objects.hash(photoUrls, name, id, category, tags, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -153,12 +153,12 @@ public enum StatusEnum {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineResponse200 {\n");
|
||||
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -0,0 +1,69 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class Model200Response {
|
||||
|
||||
@SerializedName("name")
|
||||
private Integer name = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Model200Response _200Response = (Model200Response) o;
|
||||
return Objects.equals(this.name, _200Response.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Model200Response {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class ModelReturn {
|
||||
|
||||
@SerializedName("return")
|
||||
private Integer _return = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
public void setReturn(Integer _return) {
|
||||
this._return = _return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelReturn _return = (ModelReturn) o;
|
||||
return Objects.equals(this._return, _return._return);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_return);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelReturn {\n");
|
||||
|
||||
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class Name {
|
||||
|
||||
@SerializedName("name")
|
||||
private Integer name = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Name name = (Name) o;
|
||||
return Objects.equals(this.name, name.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Name {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
|
||||
public class Order {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -13,7 +13,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
|
||||
public class Pet {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -0,0 +1,69 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class SpecialModelName {
|
||||
|
||||
@SerializedName("$special[property.name]")
|
||||
private Long specialPropertyName = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Long getSpecialPropertyName() {
|
||||
return specialPropertyName;
|
||||
}
|
||||
public void setSpecialPropertyName(Long specialPropertyName) {
|
||||
this.specialPropertyName = specialPropertyName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SpecialModelName specialModelName = (SpecialModelName) o;
|
||||
return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(specialPropertyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SpecialModelName {\n");
|
||||
|
||||
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
|
||||
public class Tag {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -9,7 +9,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
|
||||
public class User {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -151,21 +151,25 @@ public class ApiClientTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetUsername() {
|
||||
try {
|
||||
apiClient.setUsername("my-username");
|
||||
fail("there should be no HTTP basic authentications");
|
||||
} catch (RuntimeException e) {
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof HttpBasicAuth) {
|
||||
auth = (HttpBasicAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
|
||||
@Test
|
||||
public void testSetPassword() {
|
||||
try {
|
||||
apiClient.setPassword("my-password");
|
||||
fail("there should be no HTTP basic authentications");
|
||||
} catch (RuntimeException e) {
|
||||
}
|
||||
apiClient.setUsername("my-username");
|
||||
apiClient.setPassword("my-password");
|
||||
assertEquals("my-username", auth.getUsername());
|
||||
assertEquals("my-password", auth.getPassword());
|
||||
|
||||
// reset values
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
161
samples/client/petstore/javascript-promise/README.md
Normal file
161
samples/client/petstore/javascript-promise/README.md
Normal file
@ -0,0 +1,161 @@
|
||||
# swagger-petstore
|
||||
|
||||
SwaggerPetstore - JavaScript client for swagger-petstore
|
||||
|
||||
Version: 1.0.0
|
||||
|
||||
Automatically generated by the JavaScript Swagger Codegen project:
|
||||
|
||||
- Build date: 2016-03-17T16:01:50.137+08:00
|
||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||
|
||||
## Installation
|
||||
|
||||
### Use in [Node.js](https://nodejs.org/)
|
||||
|
||||
The generated client is valid [npm](https://www.npmjs.com/) package, you can publish it as described
|
||||
in [Publishing npm packages](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
||||
|
||||
After that, you can install it into your project via:
|
||||
|
||||
```shell
|
||||
npm install swagger-petstore --save
|
||||
```
|
||||
|
||||
You can also host the generated client as a git repository on github, e.g.
|
||||
https://github.com/YOUR_USERNAME/swagger-petstore
|
||||
|
||||
Then you can install it via:
|
||||
|
||||
```shell
|
||||
npm install YOUR_USERNAME/swagger-petstore --save
|
||||
```
|
||||
|
||||
### Use in browser with [browserify](http://browserify.org/)
|
||||
|
||||
The client also works in browser environment via npm and browserify. After following
|
||||
the above steps with Node.js and installing browserify with `npm install -g browserify`,
|
||||
you can do this in your project (assuming *main.js* is your entry file):
|
||||
|
||||
```shell
|
||||
browserify main.js > bundle.js
|
||||
```
|
||||
|
||||
The generated *bundle.js* can now be included in your HTML pages.
|
||||
|
||||
## Getting Started
|
||||
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
defaultClient.timeout = 10 * 1000;
|
||||
defaultClient.defaultHeaders['Test-Header'] = 'test_value';
|
||||
|
||||
// Assuming there's a `PetApi` containing a `getPetById` method
|
||||
// which returns a model object:
|
||||
var api = new SwaggerPetstore.PetApi();
|
||||
api.getPetById(2, function(err, pet, resp) {
|
||||
console.log('HTTP status code: ' + resp.status);
|
||||
console.log('Response Content-Type: ' + resp.get('Content-Type'));
|
||||
if (err) {
|
||||
console.error(err);
|
||||
} else {
|
||||
console.log(pet);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
*SwaggerPetstore.PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*SwaggerPetstore.PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*SwaggerPetstore.PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
*SwaggerPetstore.PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*SwaggerPetstore.PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
*SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
*SwaggerPetstore.StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
|
||||
*SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*SwaggerPetstore.StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
*SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
*SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
|
||||
*SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
*SwaggerPetstore.UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
*SwaggerPetstore.UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
*SwaggerPetstore.UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
*SwaggerPetstore.UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
*SwaggerPetstore.UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
*SwaggerPetstore.UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [SwaggerPetstore.Category](docs/Category.md)
|
||||
- [SwaggerPetstore.InlineResponse200](docs/InlineResponse200.md)
|
||||
- [SwaggerPetstore.Model200Response](docs/Model200Response.md)
|
||||
- [SwaggerPetstore.ModelReturn](docs/ModelReturn.md)
|
||||
- [SwaggerPetstore.Name](docs/Name.md)
|
||||
- [SwaggerPetstore.Order](docs/Order.md)
|
||||
- [SwaggerPetstore.Pet](docs/Pet.md)
|
||||
- [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md)
|
||||
- [SwaggerPetstore.Tag](docs/Tag.md)
|
||||
- [SwaggerPetstore.User](docs/User.md)
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
- **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
|
||||
- **Location**: HTTP header
|
||||
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_http_basic
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### test_api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
### test_api_key_header
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
|
@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.Category
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Integer** | | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
# SwaggerPetstore.InlineResponse200
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**photoUrls** | **[String]** | | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
**id** | **Integer** | |
|
||||
**category** | **Object** | | [optional]
|
||||
**tags** | [**[Tag]**](Tag.md) | | [optional]
|
||||
**status** | **String** | pet status in the store | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.Model200Response
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Integer** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.ModelReturn
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_return** | **Integer** | | [optional]
|
||||
|
||||
|
8
samples/client/petstore/javascript-promise/docs/Name.md
Normal file
8
samples/client/petstore/javascript-promise/docs/Name.md
Normal file
@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.Name
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Integer** | | [optional]
|
||||
|
||||
|
13
samples/client/petstore/javascript-promise/docs/Order.md
Normal file
13
samples/client/petstore/javascript-promise/docs/Order.md
Normal file
@ -0,0 +1,13 @@
|
||||
# SwaggerPetstore.Order
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Integer** | | [optional]
|
||||
**petId** | **Integer** | | [optional]
|
||||
**quantity** | **Integer** | | [optional]
|
||||
**shipDate** | **Date** | | [optional]
|
||||
**status** | **String** | Order Status | [optional]
|
||||
**complete** | **Boolean** | | [optional]
|
||||
|
||||
|
13
samples/client/petstore/javascript-promise/docs/Pet.md
Normal file
13
samples/client/petstore/javascript-promise/docs/Pet.md
Normal file
@ -0,0 +1,13 @@
|
||||
# SwaggerPetstore.Pet
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Integer** | | [optional]
|
||||
**category** | [**Category**](Category.md) | | [optional]
|
||||
**name** | **String** | |
|
||||
**photoUrls** | **[String]** | |
|
||||
**tags** | [**[Tag]**](Tag.md) | | [optional]
|
||||
**status** | **String** | pet status in the store | [optional]
|
||||
|
||||
|
586
samples/client/petstore/javascript-promise/docs/PetApi.md
Normal file
586
samples/client/petstore/javascript-promise/docs/PetApi.md
Normal file
@ -0,0 +1,586 @@
|
||||
# SwaggerPetstore.PetApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**addPetUsingByteArray**](PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**getPetByIdInObject**](PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**petPetIdtestingByteArraytrueGet**](PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
|
||||
|
||||
<a name="addPet"></a>
|
||||
# **addPet**
|
||||
> addPet(opts)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
|
||||
};
|
||||
api.addPet(opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="addPetUsingByteArray"></a>
|
||||
# **addPetUsingByteArray**
|
||||
> addPetUsingByteArray(opts)
|
||||
|
||||
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var opts = {
|
||||
'body': "B" // {String} Pet object in the form of byte array
|
||||
};
|
||||
api.addPetUsingByteArray(opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **String**| Pet object in the form of byte array | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="deletePet"></a>
|
||||
# **deletePet**
|
||||
> deletePet(petId, opts)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var petId = 789; // {Integer} Pet id to delete
|
||||
|
||||
var opts = {
|
||||
'apiKey': "apiKey_example" // {String}
|
||||
};
|
||||
api.deletePet(petId, opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Integer**| Pet id to delete |
|
||||
**apiKey** | **String**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="findPetsByStatus"></a>
|
||||
# **findPetsByStatus**
|
||||
> [Pet] findPetsByStatus(opts)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var opts = {
|
||||
'status': ["available"] // {[String]} Status values that need to be considered for query
|
||||
};
|
||||
api.findPetsByStatus(opts).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**[String]**](String.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||
|
||||
### Return type
|
||||
|
||||
[**[Pet]**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="findPetsByTags"></a>
|
||||
# **findPetsByTags**
|
||||
> [Pet] findPetsByTags(opts)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var opts = {
|
||||
'tags': ["tags_example"] // {[String]} Tags to filter by
|
||||
};
|
||||
api.findPetsByTags(opts).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**[String]**](String.md)| Tags to filter by | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**[Pet]**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="getPetById"></a>
|
||||
# **getPetById**
|
||||
> Pet getPetById(petId)
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
var api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix['api_key'] = "Token"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
||||
|
||||
api.getPetById(petId).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Integer**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="getPetByIdInObject"></a>
|
||||
# **getPetByIdInObject**
|
||||
> InlineResponse200 getPetByIdInObject(petId)
|
||||
|
||||
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
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
var api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix['api_key'] = "Token"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
||||
|
||||
api.getPetByIdInObject(petId).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Integer**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**InlineResponse200**](InlineResponse200.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="petPetIdtestingByteArraytrueGet"></a>
|
||||
# **petPetIdtestingByteArraytrueGet**
|
||||
> 'String' petPetIdtestingByteArraytrueGet(petId)
|
||||
|
||||
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
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
var api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix['api_key'] = "Token"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
||||
|
||||
api.petPetIdtestingByteArraytrueGet(petId).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Integer**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
**'String'**
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="updatePet"></a>
|
||||
# **updatePet**
|
||||
> updatePet(opts)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
|
||||
};
|
||||
api.updatePet(opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="updatePetWithForm"></a>
|
||||
# **updatePetWithForm**
|
||||
> updatePetWithForm(petId, opts)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var petId = "petId_example"; // {String} ID of pet that needs to be updated
|
||||
|
||||
var opts = {
|
||||
'name': "name_example", // {String} Updated name of the pet
|
||||
'status': "status_example" // {String} Updated status of the pet
|
||||
};
|
||||
api.updatePetWithForm(petId, opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **String**| ID of pet that needs to be updated |
|
||||
**name** | **String**| Updated name of the pet | [optional]
|
||||
**status** | **String**| Updated status of the pet | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
> uploadFile(petId, opts)
|
||||
|
||||
uploads an image
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||
|
||||
var api = new SwaggerPetstore.PetApi()
|
||||
|
||||
var petId = 789; // {Integer} ID of pet to update
|
||||
|
||||
var opts = {
|
||||
'additionalMetadata': "additionalMetadata_example", // {String} Additional data to pass to server
|
||||
'file': "/path/to/file.txt" // {File} file to upload
|
||||
};
|
||||
api.uploadFile(petId, opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Integer**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json, application/xml
|
||||
|
@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.SpecialModelName
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**specialPropertyName** | **Integer** | | [optional]
|
||||
|
||||
|
315
samples/client/petstore/javascript-promise/docs/StoreApi.md
Normal file
315
samples/client/petstore/javascript-promise/docs/StoreApi.md
Normal file
@ -0,0 +1,315 @@
|
||||
# SwaggerPetstore.StoreApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
[**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
|
||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**getInventoryInObject**](StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
|
||||
<a name="deleteOrder"></a>
|
||||
# **deleteOrder**
|
||||
> deleteOrder(orderId)
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var api = new SwaggerPetstore.StoreApi()
|
||||
|
||||
var orderId = "orderId_example"; // {String} ID of the order that needs to be deleted
|
||||
|
||||
api.deleteOrder(orderId).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **String**| ID of the order that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="findOrdersByStatus"></a>
|
||||
# **findOrdersByStatus**
|
||||
> [Order] findOrdersByStatus(opts)
|
||||
|
||||
Finds orders by status
|
||||
|
||||
A single status value can be provided as a string
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure API key authorization: test_api_client_id
|
||||
var test_api_client_id = defaultClient.authentications['test_api_client_id'];
|
||||
test_api_client_id.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//test_api_client_id.apiKeyPrefix['x-test_api_client_id'] = "Token"
|
||||
|
||||
// Configure API key authorization: test_api_client_secret
|
||||
var test_api_client_secret = defaultClient.authentications['test_api_client_secret'];
|
||||
test_api_client_secret.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
|
||||
|
||||
var api = new SwaggerPetstore.StoreApi()
|
||||
|
||||
var opts = {
|
||||
'status': "placed" // {String} Status value that needs to be considered for query
|
||||
};
|
||||
api.findOrdersByStatus(opts).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | **String**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||
|
||||
### Return type
|
||||
|
||||
[**[Order]**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="getInventory"></a>
|
||||
# **getInventory**
|
||||
> {'String': 'Integer'} getInventory
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
var api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix['api_key'] = "Token"
|
||||
|
||||
var api = new SwaggerPetstore.StoreApi()
|
||||
api.getInventory().then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**{'String': 'Integer'}**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="getInventoryInObject"></a>
|
||||
# **getInventoryInObject**
|
||||
> Object getInventoryInObject
|
||||
|
||||
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
|
||||
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
var api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix['api_key'] = "Token"
|
||||
|
||||
var api = new SwaggerPetstore.StoreApi()
|
||||
api.getInventoryInObject().then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**Object**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="getOrderById"></a>
|
||||
# **getOrderById**
|
||||
> Order getOrderById(orderId)
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure API key authorization: test_api_key_query
|
||||
var test_api_key_query = defaultClient.authentications['test_api_key_query'];
|
||||
test_api_key_query.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//test_api_key_query.apiKeyPrefix['test_api_key_query'] = "Token"
|
||||
|
||||
// Configure API key authorization: test_api_key_header
|
||||
var test_api_key_header = defaultClient.authentications['test_api_key_header'];
|
||||
test_api_key_header.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//test_api_key_header.apiKeyPrefix['test_api_key_header'] = "Token"
|
||||
|
||||
var api = new SwaggerPetstore.StoreApi()
|
||||
|
||||
var orderId = "orderId_example"; // {String} ID of pet that needs to be fetched
|
||||
|
||||
api.getOrderById(orderId).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **String**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_key_query](../README.md#test_api_key_query), [test_api_key_header](../README.md#test_api_key_header)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="placeOrder"></a>
|
||||
# **placeOrder**
|
||||
> Order placeOrder(opts)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure API key authorization: test_api_client_id
|
||||
var test_api_client_id = defaultClient.authentications['test_api_client_id'];
|
||||
test_api_client_id.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//test_api_client_id.apiKeyPrefix['x-test_api_client_id'] = "Token"
|
||||
|
||||
// Configure API key authorization: test_api_client_secret
|
||||
var test_api_client_secret = defaultClient.authentications['test_api_client_secret'];
|
||||
test_api_client_secret.apiKey = "YOUR API KEY"
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
|
||||
|
||||
var api = new SwaggerPetstore.StoreApi()
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.Order() // {Order} order placed for purchasing the pet
|
||||
};
|
||||
api.placeOrder(opts).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
9
samples/client/petstore/javascript-promise/docs/Tag.md
Normal file
9
samples/client/petstore/javascript-promise/docs/Tag.md
Normal file
@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.Tag
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Integer** | | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
15
samples/client/petstore/javascript-promise/docs/User.md
Normal file
15
samples/client/petstore/javascript-promise/docs/User.md
Normal file
@ -0,0 +1,15 @@
|
||||
# SwaggerPetstore.User
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Integer** | | [optional]
|
||||
**username** | **String** | | [optional]
|
||||
**firstName** | **String** | | [optional]
|
||||
**lastName** | **String** | | [optional]
|
||||
**email** | **String** | | [optional]
|
||||
**password** | **String** | | [optional]
|
||||
**phone** | **String** | | [optional]
|
||||
**userStatus** | **Integer** | User Status | [optional]
|
||||
|
||||
|
370
samples/client/petstore/javascript-promise/docs/UserApi.md
Normal file
370
samples/client/petstore/javascript-promise/docs/UserApi.md
Normal file
@ -0,0 +1,370 @@
|
||||
# SwaggerPetstore.UserApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
|
||||
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
<a name="createUser"></a>
|
||||
# **createUser**
|
||||
> createUser(opts)
|
||||
|
||||
Create user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var api = new SwaggerPetstore.UserApi()
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.User() // {User} Created user object
|
||||
};
|
||||
api.createUser(opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](User.md)| Created user object | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="createUsersWithArrayInput"></a>
|
||||
# **createUsersWithArrayInput**
|
||||
> createUsersWithArrayInput(opts)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var api = new SwaggerPetstore.UserApi()
|
||||
|
||||
var opts = {
|
||||
'body': [new SwaggerPetstore.User()] // {[User]} List of user object
|
||||
};
|
||||
api.createUsersWithArrayInput(opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**[User]**](User.md)| List of user object | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="createUsersWithListInput"></a>
|
||||
# **createUsersWithListInput**
|
||||
> createUsersWithListInput(opts)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var api = new SwaggerPetstore.UserApi()
|
||||
|
||||
var opts = {
|
||||
'body': [new SwaggerPetstore.User()] // {[User]} List of user object
|
||||
};
|
||||
api.createUsersWithListInput(opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**[User]**](User.md)| List of user object | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="deleteUser"></a>
|
||||
# **deleteUser**
|
||||
> deleteUser(username)
|
||||
|
||||
Delete user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure HTTP basic authorization: test_http_basic
|
||||
var test_http_basic = defaultClient.authentications['test_http_basic'];
|
||||
test_http_basic.username = 'YOUR USERNAME'
|
||||
test_http_basic.password = 'YOUR PASSWORD'
|
||||
|
||||
var api = new SwaggerPetstore.UserApi()
|
||||
|
||||
var username = "username_example"; // {String} The name that needs to be deleted
|
||||
|
||||
api.deleteUser(username).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The name that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_http_basic](../README.md#test_http_basic)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="getUserByName"></a>
|
||||
# **getUserByName**
|
||||
> User getUserByName(username)
|
||||
|
||||
Get user by user name
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var api = new SwaggerPetstore.UserApi()
|
||||
|
||||
var username = "username_example"; // {String} The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
api.getUserByName(username).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
|
||||
|
||||
### Return type
|
||||
|
||||
[**User**](User.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="loginUser"></a>
|
||||
# **loginUser**
|
||||
> 'String' loginUser(opts)
|
||||
|
||||
Logs user into the system
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var api = new SwaggerPetstore.UserApi()
|
||||
|
||||
var opts = {
|
||||
'username': "username_example", // {String} The user name for login
|
||||
'password': "password_example" // {String} The password for login in clear text
|
||||
};
|
||||
api.loginUser(opts).then(function(data) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The user name for login | [optional]
|
||||
**password** | **String**| The password for login in clear text | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**'String'**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="logoutUser"></a>
|
||||
# **logoutUser**
|
||||
> logoutUser
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var api = new SwaggerPetstore.UserApi()
|
||||
api.logoutUser().then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
<a name="updateUser"></a>
|
||||
# **updateUser**
|
||||
> updateUser(username, opts)
|
||||
|
||||
Updated user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger-petstore');
|
||||
|
||||
var api = new SwaggerPetstore.UserApi()
|
||||
|
||||
var username = "username_example"; // {String} name that need to be deleted
|
||||
|
||||
var opts = {
|
||||
'body': new SwaggerPetstore.User() // {User} Updated user object
|
||||
};
|
||||
api.updateUser(username, opts).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| name that need to be deleted |
|
||||
**body** | [**User**](User.md)| Updated user object | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
52
samples/client/petstore/javascript-promise/git_push.sh
Normal file
52
samples/client/petstore/javascript-promise/git_push.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="YOUR_GIT_USR_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="YOUR_GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
||||
|
@ -26,6 +26,7 @@
|
||||
'test_api_client_id': {type: 'apiKey', in: 'header', name: 'x-test_api_client_id'},
|
||||
'test_api_client_secret': {type: 'apiKey', in: 'header', name: 'x-test_api_client_secret'},
|
||||
'api_key': {type: 'apiKey', in: 'header', name: 'api_key'},
|
||||
'test_http_basic': {type: 'basic'},
|
||||
'test_api_key_query': {type: 'apiKey', in: 'query', name: 'test_api_key_query'},
|
||||
'test_api_key_header': {type: 'apiKey', in: 'header', name: 'test_api_key_header'}
|
||||
};
|
||||
|
@ -21,38 +21,6 @@
|
||||
var self = this;
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param {Pet} opts['body'] Pet object that needs to be added to the store
|
||||
*/
|
||||
self.updatePet = function(opts) {
|
||||
opts = opts || {};
|
||||
var postBody = opts['body'];
|
||||
|
||||
|
||||
var pathParams = {
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth'];
|
||||
var contentTypes = ['application/json', 'application/xml'];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet', 'PUT',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
@ -85,10 +53,82 @@
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
* @param {String} opts['body'] Pet object in the form of byte array
|
||||
*/
|
||||
self.addPetUsingByteArray = function(opts) {
|
||||
opts = opts || {};
|
||||
var postBody = opts['body'];
|
||||
|
||||
|
||||
var pathParams = {
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth'];
|
||||
var contentTypes = ['application/json', 'application/xml'];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet?testing_byte_array=true', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param {Integer} petId Pet id to delete
|
||||
* @param {String} opts['apiKey']
|
||||
*/
|
||||
self.deletePet = function(petId, opts) {
|
||||
opts = opts || {};
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw "Missing the required parameter 'petId' when calling deletePet";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'petId': petId
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
'api_key': opts['apiKey']
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth'];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet/{petId}', 'DELETE',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param {[String]} opts['status'] Status values that need to be considered for query
|
||||
* @param {[String]} opts['status'] Status values that need to be considered for query (default to available)
|
||||
* data is of type: [Pet]
|
||||
*/
|
||||
self.findPetsByStatus = function(opts) {
|
||||
@ -191,130 +231,6 @@
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param {String} petId ID of pet that needs to be updated
|
||||
* @param {String} opts['name'] Updated name of the pet
|
||||
* @param {String} opts['status'] Updated status of the pet
|
||||
*/
|
||||
self.updatePetWithForm = function(petId, opts) {
|
||||
opts = opts || {};
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw "Missing the required parameter 'petId' when calling updatePetWithForm";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'petId': petId
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
'name': opts['name'],
|
||||
'status': opts['status']
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth'];
|
||||
var contentTypes = ['application/x-www-form-urlencoded'];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet/{petId}', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param {Integer} petId Pet id to delete
|
||||
* @param {String} opts['apiKey']
|
||||
*/
|
||||
self.deletePet = function(petId, opts) {
|
||||
opts = opts || {};
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw "Missing the required parameter 'petId' when calling deletePet";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'petId': petId
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
'api_key': opts['apiKey']
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth'];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet/{petId}', 'DELETE',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param {Integer} petId ID of pet to update
|
||||
* @param {String} opts['additionalMetadata'] Additional data to pass to server
|
||||
* @param {File} opts['file'] file to upload
|
||||
*/
|
||||
self.uploadFile = function(petId, opts) {
|
||||
opts = opts || {};
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw "Missing the required parameter 'petId' when calling uploadFile";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'petId': petId
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
'additionalMetadata': opts['additionalMetadata'],
|
||||
'file': opts['file']
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth'];
|
||||
var contentTypes = ['multipart/form-data'];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet/{petId}/uploadImage', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -392,11 +308,11 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param {String} opts['body'] Pet object in the form of byte array
|
||||
* @param {Pet} opts['body'] Pet object that needs to be added to the store
|
||||
*/
|
||||
self.addPetUsingByteArray = function(opts) {
|
||||
self.updatePet = function(opts) {
|
||||
opts = opts || {};
|
||||
var postBody = opts['body'];
|
||||
|
||||
@ -416,7 +332,91 @@
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet?testing_byte_array=true', 'POST',
|
||||
'/pet', 'PUT',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param {String} petId ID of pet that needs to be updated
|
||||
* @param {String} opts['name'] Updated name of the pet
|
||||
* @param {String} opts['status'] Updated status of the pet
|
||||
*/
|
||||
self.updatePetWithForm = function(petId, opts) {
|
||||
opts = opts || {};
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw "Missing the required parameter 'petId' when calling updatePetWithForm";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'petId': petId
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
'name': opts['name'],
|
||||
'status': opts['status']
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth'];
|
||||
var contentTypes = ['application/x-www-form-urlencoded'];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet/{petId}', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param {Integer} petId ID of pet to update
|
||||
* @param {String} opts['additionalMetadata'] Additional data to pass to server
|
||||
* @param {File} opts['file'] file to upload
|
||||
*/
|
||||
self.uploadFile = function(petId, opts) {
|
||||
opts = opts || {};
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw "Missing the required parameter 'petId' when calling uploadFile";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'petId': petId
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
'additionalMetadata': opts['additionalMetadata'],
|
||||
'file': opts['file']
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth'];
|
||||
var contentTypes = ['multipart/form-data'];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet/{petId}/uploadImage', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
@ -21,10 +21,47 @@
|
||||
var self = this;
|
||||
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param {String} orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
self.deleteOrder = function(orderId) {
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw "Missing the required parameter 'orderId' when calling deleteOrder";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'orderId': orderId
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = [];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/store/order/{orderId}', 'DELETE',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
* @param {String} opts['status'] Status value that needs to be considered for query
|
||||
* @param {String} opts['status'] Status value that needs to be considered for query (default to placed)
|
||||
* data is of type: [Order]
|
||||
*/
|
||||
self.findOrdersByStatus = function(opts) {
|
||||
@ -117,39 +154,6 @@
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param {Order} opts['body'] order placed for purchasing the pet
|
||||
* data is of type: Order
|
||||
*/
|
||||
self.placeOrder = function(opts) {
|
||||
opts = opts || {};
|
||||
var postBody = opts['body'];
|
||||
|
||||
|
||||
var pathParams = {
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = ['test_api_client_id', 'test_api_client_secret'];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = Order;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/store/order', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
@ -189,21 +193,17 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param {String} orderId ID of the order that needs to be deleted
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param {Order} opts['body'] order placed for purchasing the pet
|
||||
* data is of type: Order
|
||||
*/
|
||||
self.deleteOrder = function(orderId) {
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw "Missing the required parameter 'orderId' when calling deleteOrder";
|
||||
}
|
||||
self.placeOrder = function(opts) {
|
||||
opts = opts || {};
|
||||
var postBody = opts['body'];
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'orderId': orderId
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
@ -212,13 +212,13 @@
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = [];
|
||||
var authNames = ['test_api_client_id', 'test_api_client_secret'];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
var returnType = Order;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/store/order/{orderId}', 'DELETE',
|
||||
'/store/order', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
@ -117,6 +117,81 @@
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param {String} username The name that needs to be deleted
|
||||
*/
|
||||
self.deleteUser = function(username) {
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw "Missing the required parameter 'username' when calling deleteUser";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'username': username
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = ['test_http_basic'];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/user/{username}', 'DELETE',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
||||
* data is of type: User
|
||||
*/
|
||||
self.getUserByName = function(username) {
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw "Missing the required parameter 'username' when calling getUserByName";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'username': username
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = [];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = User;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/user/{username}', 'GET',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
@ -183,44 +258,6 @@
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
||||
* data is of type: User
|
||||
*/
|
||||
self.getUserByName = function(username) {
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw "Missing the required parameter 'username' when calling getUserByName";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'username': username
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = [];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = User;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/user/{username}', 'GET',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
@ -260,43 +297,6 @@
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param {String} username The name that needs to be deleted
|
||||
*/
|
||||
self.deleteUser = function(username) {
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw "Missing the required parameter 'username' when calling deleteUser";
|
||||
}
|
||||
|
||||
|
||||
var pathParams = {
|
||||
'username': username
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = [];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/user/{username}', 'DELETE',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -1,26 +1,28 @@
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['./ApiClient', './model/Order', './model/SpecialModelName', './model/User', './model/Category', './model/ObjectReturn', './model/InlineResponse200', './model/Tag', './model/Pet', './api/UserApi', './api/StoreApi', './api/PetApi'], factory);
|
||||
define(['./ApiClient', './model/Category', './model/InlineResponse200', './model/Model200Response', './model/ModelReturn', './model/Name', './model/Order', './model/Pet', './model/SpecialModelName', './model/Tag', './model/User', './api/PetApi', './api/StoreApi', './api/UserApi'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('./ApiClient'), require('./model/Order'), require('./model/SpecialModelName'), require('./model/User'), require('./model/Category'), require('./model/ObjectReturn'), require('./model/InlineResponse200'), require('./model/Tag'), require('./model/Pet'), require('./api/UserApi'), require('./api/StoreApi'), require('./api/PetApi'));
|
||||
module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/InlineResponse200'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
}
|
||||
}(function(ApiClient, Order, SpecialModelName, User, Category, ObjectReturn, InlineResponse200, Tag, Pet, UserApi, StoreApi, PetApi) {
|
||||
}(function(ApiClient, Category, InlineResponse200, Model200Response, ModelReturn, Name, Order, Pet, SpecialModelName, Tag, User, PetApi, StoreApi, UserApi) {
|
||||
'use strict';
|
||||
|
||||
return {
|
||||
ApiClient: ApiClient,
|
||||
Order: Order,
|
||||
SpecialModelName: SpecialModelName,
|
||||
User: User,
|
||||
Category: Category,
|
||||
ObjectReturn: ObjectReturn,
|
||||
InlineResponse200: InlineResponse200,
|
||||
Tag: Tag,
|
||||
Model200Response: Model200Response,
|
||||
ModelReturn: ModelReturn,
|
||||
Name: Name,
|
||||
Order: Order,
|
||||
Pet: Pet,
|
||||
UserApi: UserApi,
|
||||
SpecialModelName: SpecialModelName,
|
||||
Tag: Tag,
|
||||
User: User,
|
||||
PetApi: PetApi,
|
||||
StoreApi: StoreApi,
|
||||
PetApi: PetApi
|
||||
UserApi: UserApi
|
||||
};
|
||||
}));
|
||||
|
@ -0,0 +1,59 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.SwaggerPetstore) {
|
||||
root.SwaggerPetstore = {};
|
||||
}
|
||||
root.SwaggerPetstore.Model200Response = factory(root.SwaggerPetstore.ApiClient);
|
||||
}
|
||||
}(this, function(ApiClient) {
|
||||
'use strict';
|
||||
|
||||
|
||||
var Model200Response = function Model200Response() {
|
||||
|
||||
};
|
||||
|
||||
Model200Response.constructFromObject = function(data) {
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
var _this = new Model200Response();
|
||||
|
||||
if (data['name']) {
|
||||
_this['name'] = ApiClient.convertToType(data['name'], 'Integer');
|
||||
}
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return {Integer}
|
||||
**/
|
||||
Model200Response.prototype.getName = function() {
|
||||
return this['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Integer} name
|
||||
**/
|
||||
Model200Response.prototype.setName = function(name) {
|
||||
this['name'] = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return Model200Response;
|
||||
|
||||
|
||||
}));
|
@ -0,0 +1,59 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.SwaggerPetstore) {
|
||||
root.SwaggerPetstore = {};
|
||||
}
|
||||
root.SwaggerPetstore.ModelReturn = factory(root.SwaggerPetstore.ApiClient);
|
||||
}
|
||||
}(this, function(ApiClient) {
|
||||
'use strict';
|
||||
|
||||
|
||||
var ModelReturn = function ModelReturn() {
|
||||
|
||||
};
|
||||
|
||||
ModelReturn.constructFromObject = function(data) {
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
var _this = new ModelReturn();
|
||||
|
||||
if (data['return']) {
|
||||
_this['return'] = ApiClient.convertToType(data['return'], 'Integer');
|
||||
}
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return {Integer}
|
||||
**/
|
||||
ModelReturn.prototype.getReturn = function() {
|
||||
return this['return'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Integer} _return
|
||||
**/
|
||||
ModelReturn.prototype.setReturn = function(_return) {
|
||||
this['return'] = _return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return ModelReturn;
|
||||
|
||||
|
||||
}));
|
59
samples/client/petstore/javascript-promise/src/model/Name.js
Normal file
59
samples/client/petstore/javascript-promise/src/model/Name.js
Normal file
@ -0,0 +1,59 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.SwaggerPetstore) {
|
||||
root.SwaggerPetstore = {};
|
||||
}
|
||||
root.SwaggerPetstore.Name = factory(root.SwaggerPetstore.ApiClient);
|
||||
}
|
||||
}(this, function(ApiClient) {
|
||||
'use strict';
|
||||
|
||||
|
||||
var Name = function Name() {
|
||||
|
||||
};
|
||||
|
||||
Name.constructFromObject = function(data) {
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
var _this = new Name();
|
||||
|
||||
if (data['name']) {
|
||||
_this['name'] = ApiClient.convertToType(data['name'], 'Integer');
|
||||
}
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return {Integer}
|
||||
**/
|
||||
Name.prototype.getName = function() {
|
||||
return this['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Integer} name
|
||||
**/
|
||||
Name.prototype.setName = function(name) {
|
||||
this['name'] = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return Name;
|
||||
|
||||
|
||||
}));
|
@ -13,6 +13,7 @@ describe('ApiClient', function() {
|
||||
expect(apiClient.authentications).to.eql({
|
||||
petstore_auth: {type: 'oauth2'},
|
||||
api_key: {type: 'apiKey', in: 'header', name: 'api_key'},
|
||||
test_http_basic: {type: 'basic'},
|
||||
test_api_client_id: {
|
||||
type: 'apiKey',
|
||||
in: 'header',
|
||||
|
@ -6,7 +6,7 @@ Version: 1.0.0
|
||||
|
||||
Automatically generated by the JavaScript Swagger Codegen project:
|
||||
|
||||
- Build date: 2016-03-16T19:41:06.099+08:00
|
||||
- Build date: 2016-03-17T16:01:44.795+08:00
|
||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||
|
||||
## Installation
|
||||
@ -103,6 +103,7 @@ Class | Method | HTTP request | Description
|
||||
|
||||
- [SwaggerPetstore.Category](docs/Category.md)
|
||||
- [SwaggerPetstore.InlineResponse200](docs/InlineResponse200.md)
|
||||
- [SwaggerPetstore.Model200Response](docs/Model200Response.md)
|
||||
- [SwaggerPetstore.ModelReturn](docs/ModelReturn.md)
|
||||
- [SwaggerPetstore.Name](docs/Name.md)
|
||||
- [SwaggerPetstore.Order](docs/Order.md)
|
||||
|
@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.Model200Response
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Integer** | | [optional]
|
||||
|
||||
|
@ -8,17 +8,17 @@ git_repo_id=$2
|
||||
release_note=$3
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id=""
|
||||
git_user_id="YOUR_GIT_USR_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id=""
|
||||
git_repo_id="YOUR_GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note=""
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
|
@ -131,7 +131,7 @@
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param {[String]} opts['status'] Status values that need to be considered for query
|
||||
* @param {[String]} opts['status'] Status values that need to be considered for query (default to available)
|
||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||
* data is of type: [Pet]
|
||||
*/
|
||||
|
@ -62,7 +62,7 @@
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
* @param {String} opts['status'] Status value that needs to be considered for query
|
||||
* @param {String} opts['status'] Status value that needs to be considered for query (default to placed)
|
||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||
* data is of type: [Order]
|
||||
*/
|
||||
|
@ -1,18 +1,19 @@
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['./ApiClient', './model/Category', './model/InlineResponse200', './model/ModelReturn', './model/Name', './model/Order', './model/Pet', './model/SpecialModelName', './model/Tag', './model/User', './api/PetApi', './api/StoreApi', './api/UserApi'], factory);
|
||||
define(['./ApiClient', './model/Category', './model/InlineResponse200', './model/Model200Response', './model/ModelReturn', './model/Name', './model/Order', './model/Pet', './model/SpecialModelName', './model/Tag', './model/User', './api/PetApi', './api/StoreApi', './api/UserApi'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/InlineResponse200'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/InlineResponse200'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
}
|
||||
}(function(ApiClient, Category, InlineResponse200, ModelReturn, Name, Order, Pet, SpecialModelName, Tag, User, PetApi, StoreApi, UserApi) {
|
||||
}(function(ApiClient, Category, InlineResponse200, Model200Response, ModelReturn, Name, Order, Pet, SpecialModelName, Tag, User, PetApi, StoreApi, UserApi) {
|
||||
'use strict';
|
||||
|
||||
return {
|
||||
ApiClient: ApiClient,
|
||||
Category: Category,
|
||||
InlineResponse200: InlineResponse200,
|
||||
Model200Response: Model200Response,
|
||||
ModelReturn: ModelReturn,
|
||||
Name: Name,
|
||||
Order: Order,
|
||||
|
@ -0,0 +1,59 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.SwaggerPetstore) {
|
||||
root.SwaggerPetstore = {};
|
||||
}
|
||||
root.SwaggerPetstore.Model200Response = factory(root.SwaggerPetstore.ApiClient);
|
||||
}
|
||||
}(this, function(ApiClient) {
|
||||
'use strict';
|
||||
|
||||
|
||||
var Model200Response = function Model200Response() {
|
||||
|
||||
};
|
||||
|
||||
Model200Response.constructFromObject = function(data) {
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
var _this = new Model200Response();
|
||||
|
||||
if (data['name']) {
|
||||
_this['name'] = ApiClient.convertToType(data['name'], 'Integer');
|
||||
}
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return {Integer}
|
||||
**/
|
||||
Model200Response.prototype.getName = function() {
|
||||
return this['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Integer} name
|
||||
**/
|
||||
Model200Response.prototype.setName = function(name) {
|
||||
this['name'] = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return Model200Response;
|
||||
|
||||
|
||||
}));
|
@ -6,7 +6,7 @@ Version: 1.0.0
|
||||
|
||||
Automatically generated by the Ruby Swagger Codegen project:
|
||||
|
||||
- Build date: 2016-03-16T23:43:41.882+08:00
|
||||
- Build date: 2016-03-17T16:01:35.253+08:00
|
||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
@ -120,10 +120,25 @@ Class | Method | HTTP request | Description
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
### test_api_key_header
|
||||
### 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
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **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
|
||||
- **Location**: HTTP header
|
||||
|
||||
### api_key
|
||||
@ -136,30 +151,15 @@ 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
|
||||
|
||||
### petstore_auth
|
||||
### test_api_key_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
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
|
||||
|
@ -3,11 +3,11 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**tags** | [**Array<Tag>**](Tag.md) | | [optional]
|
||||
**photo_urls** | **Array<String>** | | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
**id** | **Integer** | |
|
||||
**category** | **Object** | | [optional]
|
||||
**tags** | [**Array<Tag>**](Tag.md) | | [optional]
|
||||
**status** | **String** | pet status in the store | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
**photo_urls** | **Array<String>** | | [optional]
|
||||
|
||||
|
||||
|
@ -284,13 +284,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API erro
|
||||
require 'petstore'
|
||||
|
||||
Petstore.configure do |config|
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = "YOUR ACCESS TOKEN"
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
config.api_key['api_key'] = "YOUR API KEY"
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to nil)
|
||||
#config.api_key_prefix['api_key'] = "Token"
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = "YOUR ACCESS TOKEN"
|
||||
end
|
||||
|
||||
api = Petstore::PetApi.new
|
||||
@ -318,7 +318,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
@ -339,13 +339,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API erro
|
||||
require 'petstore'
|
||||
|
||||
Petstore.configure do |config|
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = "YOUR ACCESS TOKEN"
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
config.api_key['api_key'] = "YOUR API KEY"
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to nil)
|
||||
#config.api_key_prefix['api_key'] = "Token"
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = "YOUR ACCESS TOKEN"
|
||||
end
|
||||
|
||||
api = Petstore::PetApi.new
|
||||
@ -373,7 +373,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
@ -394,13 +394,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API erro
|
||||
require 'petstore'
|
||||
|
||||
Petstore.configure do |config|
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = "YOUR ACCESS TOKEN"
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
config.api_key['api_key'] = "YOUR API KEY"
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to nil)
|
||||
#config.api_key_prefix['api_key'] = "Token"
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = "YOUR ACCESS TOKEN"
|
||||
end
|
||||
|
||||
api = Petstore::PetApi.new
|
||||
@ -428,7 +428,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
|
@ -218,15 +218,15 @@ For valid response try integer IDs with value <= 5 or > 10. Other values w
|
||||
require 'petstore'
|
||||
|
||||
Petstore.configure do |config|
|
||||
# Configure API key authorization: test_api_key_header
|
||||
config.api_key['test_api_key_header'] = "YOUR API KEY"
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to nil)
|
||||
#config.api_key_prefix['test_api_key_header'] = "Token"
|
||||
|
||||
# Configure API key authorization: test_api_key_query
|
||||
config.api_key['test_api_key_query'] = "YOUR API KEY"
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to nil)
|
||||
#config.api_key_prefix['test_api_key_query'] = "Token"
|
||||
|
||||
# Configure API key authorization: test_api_key_header
|
||||
config.api_key['test_api_key_header'] = "YOUR API KEY"
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to nil)
|
||||
#config.api_key_prefix['test_api_key_header'] = "Token"
|
||||
end
|
||||
|
||||
api = Petstore::StoreApi.new
|
||||
@ -254,7 +254,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||
[test_api_key_query](../README.md#test_api_key_query), [test_api_key_header](../README.md#test_api_key_header)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
|
@ -201,7 +201,7 @@ module Petstore
|
||||
# Finds Pets by status
|
||||
# Multiple status values can be provided with comma separated strings
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :status Status values that need to be considered for query
|
||||
# @option opts [Array<String>] :status Status values that need to be considered for query (default to available)
|
||||
# @return [Array<Pet>]
|
||||
def find_pets_by_status(opts = {})
|
||||
data, status_code, headers = find_pets_by_status_with_http_info(opts)
|
||||
@ -360,7 +360,7 @@ module Petstore
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
|
||||
auth_names = ['api_key', 'petstore_auth']
|
||||
auth_names = ['petstore_auth', 'api_key']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
@ -420,7 +420,7 @@ module Petstore
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
|
||||
auth_names = ['api_key', 'petstore_auth']
|
||||
auth_names = ['petstore_auth', 'api_key']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
@ -480,7 +480,7 @@ module Petstore
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
|
||||
auth_names = ['api_key', 'petstore_auth']
|
||||
auth_names = ['petstore_auth', 'api_key']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
|
@ -86,7 +86,7 @@ module Petstore
|
||||
# Finds orders by status
|
||||
# A single status value can be provided as a string
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :status Status value that needs to be considered for query
|
||||
# @option opts [String] :status Status value that needs to be considered for query (default to placed)
|
||||
# @return [Array<Order>]
|
||||
def find_orders_by_status(opts = {})
|
||||
data, status_code, headers = find_orders_by_status_with_http_info(opts)
|
||||
@ -301,7 +301,7 @@ module Petstore
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
|
||||
auth_names = ['test_api_key_header', 'test_api_key_query']
|
||||
auth_names = ['test_api_key_query', 'test_api_key_header']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
|
@ -157,12 +157,26 @@ module Petstore
|
||||
# Returns Auth Settings hash for api client.
|
||||
def auth_settings
|
||||
{
|
||||
'test_api_key_header' =>
|
||||
'petstore_auth' =>
|
||||
{
|
||||
type: 'oauth2',
|
||||
in: 'header',
|
||||
key: 'Authorization',
|
||||
value: "Bearer #{access_token}"
|
||||
},
|
||||
'test_api_client_id' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
in: 'header',
|
||||
key: 'test_api_key_header',
|
||||
value: api_key_with_prefix('test_api_key_header')
|
||||
key: 'x-test_api_client_id',
|
||||
value: api_key_with_prefix('x-test_api_client_id')
|
||||
},
|
||||
'test_api_client_secret' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
in: 'header',
|
||||
key: 'x-test_api_client_secret',
|
||||
value: api_key_with_prefix('x-test_api_client_secret')
|
||||
},
|
||||
'api_key' =>
|
||||
{
|
||||
@ -178,20 +192,6 @@ module Petstore
|
||||
key: 'Authorization',
|
||||
value: basic_auth_token
|
||||
},
|
||||
'test_api_client_secret' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
in: 'header',
|
||||
key: 'x-test_api_client_secret',
|
||||
value: api_key_with_prefix('x-test_api_client_secret')
|
||||
},
|
||||
'test_api_client_id' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
in: 'header',
|
||||
key: 'x-test_api_client_id',
|
||||
value: api_key_with_prefix('x-test_api_client_id')
|
||||
},
|
||||
'test_api_key_query' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
@ -199,12 +199,12 @@ module Petstore
|
||||
key: 'test_api_key_query',
|
||||
value: api_key_with_prefix('test_api_key_query')
|
||||
},
|
||||
'petstore_auth' =>
|
||||
'test_api_key_header' =>
|
||||
{
|
||||
type: 'oauth2',
|
||||
type: 'api_key',
|
||||
in: 'header',
|
||||
key: 'Authorization',
|
||||
value: "Bearer #{access_token}"
|
||||
key: 'test_api_key_header',
|
||||
value: api_key_with_prefix('test_api_key_header')
|
||||
},
|
||||
}
|
||||
end
|
||||
|
@ -18,34 +18,34 @@ require 'date'
|
||||
|
||||
module Petstore
|
||||
class InlineResponse200
|
||||
attr_accessor :tags
|
||||
attr_accessor :photo_urls
|
||||
|
||||
attr_accessor :name
|
||||
|
||||
attr_accessor :id
|
||||
|
||||
attr_accessor :category
|
||||
|
||||
attr_accessor :tags
|
||||
|
||||
# pet status in the store
|
||||
attr_accessor :status
|
||||
|
||||
attr_accessor :name
|
||||
|
||||
attr_accessor :photo_urls
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
|
||||
:'tags' => :'tags',
|
||||
:'photo_urls' => :'photoUrls',
|
||||
|
||||
:'name' => :'name',
|
||||
|
||||
:'id' => :'id',
|
||||
|
||||
:'category' => :'category',
|
||||
|
||||
:'status' => :'status',
|
||||
:'tags' => :'tags',
|
||||
|
||||
:'name' => :'name',
|
||||
|
||||
:'photo_urls' => :'photoUrls'
|
||||
:'status' => :'status'
|
||||
|
||||
}
|
||||
end
|
||||
@ -53,12 +53,12 @@ module Petstore
|
||||
# Attribute type mapping.
|
||||
def self.swagger_types
|
||||
{
|
||||
:'tags' => :'Array<Tag>',
|
||||
:'photo_urls' => :'Array<String>',
|
||||
:'name' => :'String',
|
||||
:'id' => :'Integer',
|
||||
:'category' => :'Object',
|
||||
:'status' => :'String',
|
||||
:'name' => :'String',
|
||||
:'photo_urls' => :'Array<String>'
|
||||
:'tags' => :'Array<Tag>',
|
||||
:'status' => :'String'
|
||||
|
||||
}
|
||||
end
|
||||
@ -70,12 +70,16 @@ module Petstore
|
||||
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
||||
|
||||
|
||||
if attributes[:'tags']
|
||||
if (value = attributes[:'tags']).is_a?(Array)
|
||||
self.tags = value
|
||||
if attributes[:'photoUrls']
|
||||
if (value = attributes[:'photoUrls']).is_a?(Array)
|
||||
self.photo_urls = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes[:'name']
|
||||
self.name = attributes[:'name']
|
||||
end
|
||||
|
||||
if attributes[:'id']
|
||||
self.id = attributes[:'id']
|
||||
end
|
||||
@ -84,20 +88,16 @@ module Petstore
|
||||
self.category = attributes[:'category']
|
||||
end
|
||||
|
||||
if attributes[:'tags']
|
||||
if (value = attributes[:'tags']).is_a?(Array)
|
||||
self.tags = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes[:'status']
|
||||
self.status = attributes[:'status']
|
||||
end
|
||||
|
||||
if attributes[:'name']
|
||||
self.name = attributes[:'name']
|
||||
end
|
||||
|
||||
if attributes[:'photoUrls']
|
||||
if (value = attributes[:'photoUrls']).is_a?(Array)
|
||||
self.photo_urls = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Custom attribute writer method checking allowed values (enum).
|
||||
@ -113,12 +113,12 @@ module Petstore
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
tags == o.tags &&
|
||||
photo_urls == o.photo_urls &&
|
||||
name == o.name &&
|
||||
id == o.id &&
|
||||
category == o.category &&
|
||||
status == o.status &&
|
||||
name == o.name &&
|
||||
photo_urls == o.photo_urls
|
||||
tags == o.tags &&
|
||||
status == o.status
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
@ -128,7 +128,7 @@ module Petstore
|
||||
|
||||
# Calculate hash code according to all attributes.
|
||||
def hash
|
||||
[tags, id, category, status, name, photo_urls].hash
|
||||
[photo_urls, name, id, category, tags, status].hash
|
||||
end
|
||||
|
||||
# build the object from hash
|
||||
|
@ -36,7 +36,17 @@ describe 'InlineResponse200' do
|
||||
@instance.should be_a(Petstore::InlineResponse200)
|
||||
end
|
||||
end
|
||||
describe 'test attribute "tags"' do
|
||||
describe 'test attribute "photo_urls"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "name"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
@ -66,6 +76,16 @@ describe 'InlineResponse200' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "tags"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "status"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
@ -76,25 +96,5 @@ describe 'InlineResponse200' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "name"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "photo_urls"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user