forked from loafle/openapi-generator-original
fix swift mapping with int and number
This commit is contained in:
parent
6c7efd502b
commit
44a4219e3e
@ -1125,6 +1125,24 @@ public class DefaultCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
if (p instanceof BaseIntegerProperty) {
|
||||
BaseIntegerProperty sp = (BaseIntegerProperty) p;
|
||||
property.isInteger = true;
|
||||
/*if (sp.getEnum() != null) {
|
||||
List<Integer> _enum = sp.getEnum();
|
||||
property._enum = new ArrayList<String>();
|
||||
for(Integer i : _enum) {
|
||||
property._enum.add(i.toString());
|
||||
}
|
||||
property.isEnum = true;
|
||||
|
||||
// legacy support
|
||||
Map<String, Object> allowableValues = new HashMap<String, Object>();
|
||||
allowableValues.put("values", _enum);
|
||||
property.allowableValues = allowableValues;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (p instanceof IntegerProperty) {
|
||||
IntegerProperty sp = (IntegerProperty) p;
|
||||
property.isInteger = true;
|
||||
@ -1173,6 +1191,24 @@ public class DefaultCodegen {
|
||||
property.isByteArray = true;
|
||||
}
|
||||
|
||||
if (p instanceof DecimalProperty) {
|
||||
DecimalProperty sp = (DecimalProperty) p;
|
||||
property.isFloat = true;
|
||||
/*if (sp.getEnum() != null) {
|
||||
List<Double> _enum = sp.getEnum();
|
||||
property._enum = new ArrayList<String>();
|
||||
for(Double i : _enum) {
|
||||
property._enum.add(i.toString());
|
||||
}
|
||||
property.isEnum = true;
|
||||
|
||||
// legacy support
|
||||
Map<String, Object> allowableValues = new HashMap<String, Object>();
|
||||
allowableValues.put("values", _enum);
|
||||
property.allowableValues = allowableValues;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (p instanceof DoubleProperty) {
|
||||
DoubleProperty sp = (DoubleProperty) p;
|
||||
property.isDouble = true;
|
||||
|
@ -91,6 +91,7 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
// map binary to string as a workaround
|
||||
// the correct solution is to use []byte
|
||||
typeMapping.put("binary", "string");
|
||||
typeMapping.put("ByteArray", "string");
|
||||
|
||||
importMapping = new HashMap<String, String>();
|
||||
importMapping.put("time.Time", "time");
|
||||
|
@ -95,6 +95,7 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
//TODO binary should be mapped to byte array
|
||||
// mapped to String as a workaround
|
||||
typeMapping.put("binary", "string");
|
||||
typeMapping.put("ByteArray", "string");
|
||||
|
||||
cliOptions.clear();
|
||||
cliOptions.add(new CliOption(MODULE_NAME, "Perl module name (convention: CamelCase or Long::Module).").defaultValue("SwaggerClient"));
|
||||
|
@ -110,6 +110,7 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
typeMapping.put("list", "array");
|
||||
typeMapping.put("object", "object");
|
||||
typeMapping.put("binary", "string");
|
||||
typeMapping.put("ByteArray", "string");
|
||||
|
||||
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
|
||||
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
|
||||
|
@ -61,6 +61,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
//TODO binary should be mapped to byte array
|
||||
// mapped to String as a workaround
|
||||
typeMapping.put("binary", "str");
|
||||
typeMapping.put("ByteArray", "str");
|
||||
|
||||
// from https://docs.python.org/release/2.5.4/ref/keywords.html
|
||||
setReservedWordsLowerCase(
|
||||
|
@ -116,6 +116,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
typeMapping.put("object", "Object");
|
||||
typeMapping.put("file", "File");
|
||||
typeMapping.put("binary", "String");
|
||||
typeMapping.put("ByteArray", "String");
|
||||
|
||||
// remove modelPackage and apiPackage added by default
|
||||
Iterator<CliOption> itr = cliOptions.iterator();
|
||||
|
@ -101,6 +101,7 @@ public class ScalaClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
//TODO binary should be mapped to byte array
|
||||
// mapped to String as a workaround
|
||||
typeMapping.put("binary", "String");
|
||||
typeMapping.put("ByteArray", "String");
|
||||
|
||||
languageSpecificPrimitives = new HashSet<String>(
|
||||
Arrays.asList(
|
||||
|
@ -97,6 +97,7 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
);
|
||||
setReservedWordsLowerCase(
|
||||
Arrays.asList(
|
||||
"Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", "Character", "AnyObject",
|
||||
"class", "break", "as", "associativity", "deinit", "case", "dynamicType", "convenience", "enum", "continue",
|
||||
"false", "dynamic", "extension", "default", "is", "didSet", "func", "do", "nil", "final", "import", "else",
|
||||
"self", "get", "init", "fallthrough", "Self", "infix", "internal", "for", "super", "inout", "let", "if",
|
||||
@ -129,6 +130,7 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
//TODO binary should be mapped to byte array
|
||||
// mapped to String as a workaround
|
||||
typeMapping.put("binary", "String");
|
||||
typeMapping.put("ByteArray", "String");
|
||||
|
||||
importMapping = new HashMap<String, String>();
|
||||
|
||||
|
@ -81,7 +81,8 @@ namespace {{packageName}}.Model
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class {{classname}} {\n");
|
||||
{{#vars}}sb.Append(" {{name}}: ").Append({{name}}).Append("\n");
|
||||
{{#vars}}
|
||||
sb.Append(" {{name}}: ").Append({{name}}).Append("\n");
|
||||
{{/vars}}
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
|
@ -23,7 +23,8 @@ module {{moduleName}}{{#models}}{{#model}}{{#description}}
|
||||
# Attribute type mapping.
|
||||
def self.swagger_types
|
||||
{
|
||||
{{#vars}}:'{{{name}}}' => :'{{{datatype}}}'{{#hasMore}},{{/hasMore}}
|
||||
{{#vars}}
|
||||
:'{{{name}}}' => :'{{{datatype}}}'{{#hasMore}},{{/hasMore}}
|
||||
{{/vars}}
|
||||
}
|
||||
end
|
||||
|
@ -11,14 +11,22 @@ import Foundation
|
||||
|
||||
/** {{description}} */{{/description}}
|
||||
public class {{classname}}: JSONEncodable {
|
||||
{{#vars}}{{#isEnum}}
|
||||
{{#vars}}
|
||||
{{#isEnum}}
|
||||
public enum {{datatypeWithEnum}}: String { {{#allowableValues}}{{#values}}
|
||||
case {{enum}} = "{{raw}}"{{/values}}{{/allowableValues}}
|
||||
}
|
||||
{{/isEnum}}{{/vars}}
|
||||
{{#vars}}{{#isEnum}}{{#description}}/** {{description}} */
|
||||
{{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{#required}}!{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/isEnum}}{{^isEnum}}{{#description}}/** {{description}} */
|
||||
{{/description}}public var {{name}}: {{{datatype}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{#required}}!{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/isEnum}}
|
||||
{{/isEnum}}
|
||||
{{/vars}}
|
||||
{{#vars}}
|
||||
{{#isEnum}}
|
||||
{{#description}}/** {{description}} */
|
||||
{{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{#required}}!{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#description}}/** {{description}} */
|
||||
{{/description}}public var {{name}}: {{{datatype}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{#required}}!{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}
|
||||
{{/isEnum}}
|
||||
{{/vars}}
|
||||
|
||||
public init() {}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="TestPet.cs">
|
||||
<Files>
|
||||
<File FileName="TestPet.cs" Line="222" Column="29" />
|
||||
<File FileName="TestPet.cs" Line="216" Column="25" />
|
||||
<File FileName="TestOrder.cs" Line="1" Column="1" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
|
@ -36,7 +36,6 @@ public class PetApi {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
@ -57,9 +56,6 @@ public class PetApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -74,9 +70,7 @@ public class PetApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
@ -97,9 +91,6 @@ public class PetApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -114,9 +105,7 @@ public class PetApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
@ -142,13 +131,10 @@ public class PetApi {
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
if (apiKey != null)
|
||||
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -163,9 +149,7 @@ public class PetApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
@ -184,14 +168,10 @@ public class PetApi {
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -204,12 +184,9 @@ public class PetApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
|
||||
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
@ -228,14 +205,10 @@ public class PetApi {
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -248,12 +221,9 @@ public class PetApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
|
||||
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
@ -281,9 +251,6 @@ public class PetApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -296,12 +263,9 @@ public class PetApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
|
||||
|
||||
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -329,9 +293,6 @@ public class PetApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -344,12 +305,9 @@ public class PetApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
|
||||
|
||||
GenericType<InlineResponse200> localVarReturnType = new GenericType<InlineResponse200>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
@ -377,9 +335,6 @@ public class PetApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -392,12 +347,9 @@ public class PetApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||
|
||||
|
||||
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
@ -418,9 +370,6 @@ public class PetApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -435,9 +384,7 @@ public class PetApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
@ -465,14 +412,11 @@ public class PetApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (name != null)
|
||||
localVarFormParams.put("name", name);
|
||||
if (status != null)
|
||||
localVarFormParams.put("status", status);
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -487,9 +431,7 @@ public class PetApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
@ -517,14 +459,11 @@ public class PetApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (additionalMetadata != null)
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
if (file != null)
|
||||
localVarFormParams.put("file", file);
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -539,7 +478,5 @@ public class PetApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ public class StoreApi {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
@ -61,9 +60,6 @@ public class StoreApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -78,9 +74,7 @@ public class StoreApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
@ -99,14 +93,10 @@ public class StoreApi {
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -119,12 +109,9 @@ public class StoreApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||
|
||||
|
||||
GenericType<List<Order>> localVarReturnType = new GenericType<List<Order>>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
@ -145,9 +132,6 @@ public class StoreApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -160,12 +144,9 @@ public class StoreApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key" };
|
||||
|
||||
|
||||
GenericType<Map<String, Integer>> localVarReturnType = new GenericType<Map<String, Integer>>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
* Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
@ -186,9 +167,6 @@ public class StoreApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -201,15 +179,12 @@ public class StoreApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key" };
|
||||
|
||||
|
||||
GenericType<Object> localVarReturnType = new GenericType<Object>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* 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 (required)
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
@ -234,9 +209,6 @@ public class StoreApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -249,12 +221,9 @@ public class StoreApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "test_api_key_header", "test_api_key_query" };
|
||||
|
||||
|
||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
@ -276,9 +245,6 @@ public class StoreApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -291,10 +257,7 @@ public class StoreApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||
|
||||
|
||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ public class UserApi {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
@ -55,9 +54,6 @@ public class UserApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -72,9 +68,7 @@ public class UserApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
@ -95,9 +89,6 @@ public class UserApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -112,9 +103,7 @@ public class UserApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
@ -135,9 +124,6 @@ public class UserApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -152,9 +138,7 @@ public class UserApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
@ -181,9 +165,6 @@ public class UserApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -198,9 +179,7 @@ public class UserApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
@ -228,9 +207,6 @@ public class UserApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -243,12 +219,9 @@ public class UserApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
GenericType<User> localVarReturnType = new GenericType<User>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
@ -268,16 +241,11 @@ public class UserApi {
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
||||
|
||||
localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -290,12 +258,9 @@ public class UserApi {
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
@ -315,9 +280,6 @@ public class UserApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -332,9 +294,7 @@ public class UserApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
@ -362,9 +322,6 @@ public class UserApi {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
@ -379,7 +336,5 @@ public class UserApi {
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -50,7 +50,6 @@ public class Category {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -147,7 +147,6 @@ public class InlineResponse200 {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -7,8 +7,11 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
**/
|
||||
|
||||
|
||||
@ApiModel(description = "Model for testing model name starting with number")
|
||||
|
||||
public class Model200Response {
|
||||
|
||||
@ -32,7 +35,6 @@ public class Model200Response {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -7,8 +7,11 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
**/
|
||||
|
||||
|
||||
@ApiModel(description = "Model for testing reserved words")
|
||||
|
||||
public class ModelReturn {
|
||||
|
||||
@ -32,7 +35,6 @@ public class ModelReturn {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -7,8 +7,11 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
**/
|
||||
|
||||
|
||||
@ApiModel(description = "Model for testing model name same as property name")
|
||||
|
||||
public class Name {
|
||||
|
||||
@ -23,7 +26,7 @@ public class Name {
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
@JsonProperty("name")
|
||||
public Integer getName() {
|
||||
return name;
|
||||
@ -33,22 +36,11 @@ public class Name {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
public Name snakeCase(Integer snakeCase) {
|
||||
this.snakeCase = snakeCase;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("snake_case")
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
public void setSnakeCase(Integer snakeCase) {
|
||||
this.snakeCase = snakeCase;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -135,7 +135,6 @@ public class Order {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -148,7 +148,6 @@ public class Pet {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -32,7 +32,6 @@ public class SpecialModelName {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -50,7 +50,6 @@ public class Tag {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -159,7 +159,6 @@ public class User {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
|
@ -10,7 +10,7 @@ Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-03-30T20:57:51.908+08:00
|
||||
- Build date: 2016-04-11T17:07:28.577+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
## A note on Moose
|
||||
@ -235,6 +235,7 @@ use WWW::SwaggerClient::Object::Animal;
|
||||
use WWW::SwaggerClient::Object::Cat;
|
||||
use WWW::SwaggerClient::Object::Category;
|
||||
use WWW::SwaggerClient::Object::Dog;
|
||||
use WWW::SwaggerClient::Object::FormatTest;
|
||||
use WWW::SwaggerClient::Object::InlineResponse200;
|
||||
use WWW::SwaggerClient::Object::Model200Response;
|
||||
use WWW::SwaggerClient::Object::ModelReturn;
|
||||
@ -264,6 +265,7 @@ use WWW::SwaggerClient::Object::Animal;
|
||||
use WWW::SwaggerClient::Object::Cat;
|
||||
use WWW::SwaggerClient::Object::Category;
|
||||
use WWW::SwaggerClient::Object::Dog;
|
||||
use WWW::SwaggerClient::Object::FormatTest;
|
||||
use WWW::SwaggerClient::Object::InlineResponse200;
|
||||
use WWW::SwaggerClient::Object::Model200Response;
|
||||
use WWW::SwaggerClient::Object::ModelReturn;
|
||||
@ -299,20 +301,20 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
*PetApi* | [**add_pet_using_byte_array**](docs/PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*PetApi* | [**add_pet_using_byte_array**](docs/PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
*PetApi* | [**get_pet_by_id_in_object**](docs/PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*PetApi* | [**get_pet_by_id_in_object**](docs/PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
*StoreApi* | [**find_orders_by_status**](docs/StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||
*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||
*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
|
||||
@ -330,6 +332,7 @@ Class | Method | HTTP request | Description
|
||||
- [WWW::SwaggerClient::Object::Cat](docs/Cat.md)
|
||||
- [WWW::SwaggerClient::Object::Category](docs/Category.md)
|
||||
- [WWW::SwaggerClient::Object::Dog](docs/Dog.md)
|
||||
- [WWW::SwaggerClient::Object::FormatTest](docs/FormatTest.md)
|
||||
- [WWW::SwaggerClient::Object::InlineResponse200](docs/InlineResponse200.md)
|
||||
- [WWW::SwaggerClient::Object::Model200Response](docs/Model200Response.md)
|
||||
- [WWW::SwaggerClient::Object::ModelReturn](docs/ModelReturn.md)
|
||||
|
@ -8,7 +8,7 @@ use WWW::SwaggerClient::Object::Name;
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **int** | | [optional]
|
||||
**name** | **int** | |
|
||||
**snake_case** | **int** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -10,13 +10,13 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
|
@ -12,7 +12,7 @@ Method | HTTP request | Description
|
||||
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
|
@ -366,7 +366,6 @@ sub update_params_for_auth {
|
||||
$header_params->{'Authorization'} = 'Bearer ' . $WWW::SwaggerClient::Configuration::access_token;
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
# TODO show warning about security definition not found
|
||||
}
|
||||
|
@ -110,7 +110,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -117,7 +117,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -117,7 +117,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -117,7 +117,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -145,7 +145,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -15,7 +15,7 @@ use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#Model for testing model name starting with number
|
||||
#
|
||||
#NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
#
|
||||
@ -97,7 +97,7 @@ sub _deserialize {
|
||||
|
||||
|
||||
|
||||
__PACKAGE__->class_documentation({description => '',
|
||||
__PACKAGE__->class_documentation({description => 'Model for testing model name starting with number',
|
||||
class => 'Model200Response',
|
||||
required => [], # TODO
|
||||
} );
|
||||
@ -110,7 +110,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -15,7 +15,7 @@ use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#Model for testing reserved words
|
||||
#
|
||||
#NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
#
|
||||
@ -97,7 +97,7 @@ sub _deserialize {
|
||||
|
||||
|
||||
|
||||
__PACKAGE__->class_documentation({description => '',
|
||||
__PACKAGE__->class_documentation({description => 'Model for testing reserved words',
|
||||
class => 'ModelReturn',
|
||||
required => [], # TODO
|
||||
} );
|
||||
@ -110,7 +110,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -15,7 +15,7 @@ use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#Model for testing model name same as property name
|
||||
#
|
||||
#NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
#
|
||||
@ -97,7 +97,7 @@ sub _deserialize {
|
||||
|
||||
|
||||
|
||||
__PACKAGE__->class_documentation({description => '',
|
||||
__PACKAGE__->class_documentation({description => 'Model for testing model name same as property name',
|
||||
class => 'Name',
|
||||
required => [], # TODO
|
||||
} );
|
||||
@ -117,7 +117,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -145,7 +145,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -145,7 +145,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -110,7 +110,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -117,7 +117,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -159,7 +159,6 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
|
@ -113,7 +113,6 @@ sub add_pet {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -144,7 +143,7 @@ sub add_pet_using_byte_array {
|
||||
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet?testing_byte_array=true';
|
||||
my $_resource_path = '/pet?testing_byte_array=true';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'POST';
|
||||
@ -178,7 +177,6 @@ sub add_pet_using_byte_array {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -259,7 +257,6 @@ sub delete_pet {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -327,7 +324,6 @@ sub find_pets_by_status {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('ARRAY[Pet]', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -395,7 +391,6 @@ sub find_pets_by_tags {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('ARRAY[Pet]', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -470,7 +465,6 @@ sub get_pet_by_id {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('Pet', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -506,7 +500,7 @@ sub get_pet_by_id_in_object {
|
||||
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet/{petId}?response=inline_arbitrary_object';
|
||||
my $_resource_path = '/pet/{petId}?response=inline_arbitrary_object';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'GET';
|
||||
@ -545,7 +539,6 @@ sub get_pet_by_id_in_object {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -581,7 +574,7 @@ sub pet_pet_idtesting_byte_arraytrue_get {
|
||||
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet/{petId}?testing_byte_array=true';
|
||||
my $_resource_path = '/pet/{petId}?testing_byte_array=true';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'GET';
|
||||
@ -620,7 +613,6 @@ sub pet_pet_idtesting_byte_arraytrue_get {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('string', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -685,7 +677,6 @@ sub update_pet {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -758,14 +749,10 @@ sub update_pet_with_form {
|
||||
}
|
||||
# form params
|
||||
if ( exists $args{'name'} ) {
|
||||
|
||||
$form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
|
||||
|
||||
}# form params
|
||||
if ( exists $args{'status'} ) {
|
||||
|
||||
$form_params->{'status'} = $self->{api_client}->to_form_value($args{'status'});
|
||||
|
||||
}
|
||||
my $_body_data;
|
||||
|
||||
@ -779,7 +766,6 @@ sub update_pet_with_form {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -852,15 +838,11 @@ sub upload_file {
|
||||
}
|
||||
# form params
|
||||
if ( exists $args{'additional_metadata'} ) {
|
||||
|
||||
$form_params->{'additionalMetadata'} = $self->{api_client}->to_form_value($args{'additional_metadata'});
|
||||
|
||||
}# form params
|
||||
if ( exists $args{'file'} ) {
|
||||
$form_params->{'file'} = [] unless defined $form_params->{'file'};
|
||||
push @{$form_params->{'file'}}, $args{'file'};
|
||||
|
||||
|
||||
}
|
||||
my $_body_data;
|
||||
|
||||
@ -874,7 +856,6 @@ sub upload_file {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ has version_info => ( is => 'ro',
|
||||
default => sub { {
|
||||
app_name => 'Swagger Petstore',
|
||||
app_version => '1.0.0',
|
||||
generated_date => '2016-03-30T20:57:51.908+08:00',
|
||||
generated_date => '2016-04-11T17:07:28.577+08:00',
|
||||
generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen',
|
||||
} },
|
||||
documentation => 'Information about the application version and the codegen codebase version'
|
||||
@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project:
|
||||
|
||||
=over 4
|
||||
|
||||
=item Build date: 2016-03-30T20:57:51.908+08:00
|
||||
=item Build date: 2016-04-11T17:07:28.577+08:00
|
||||
|
||||
=item Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
|
@ -120,7 +120,6 @@ sub delete_order {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -188,7 +187,6 @@ sub find_orders_by_status {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('ARRAY[Order]', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -247,7 +245,6 @@ sub get_inventory {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('HASH[string,int]', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -272,7 +269,7 @@ sub get_inventory_in_object {
|
||||
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/store/inventory?response=arbitrary_object';
|
||||
my $_resource_path = '/store/inventory?response=arbitrary_object';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'GET';
|
||||
@ -306,7 +303,6 @@ sub get_inventory_in_object {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('object', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -381,7 +377,6 @@ sub get_order_by_id {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('Order', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -449,7 +444,6 @@ sub place_order {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('Order', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -113,7 +113,6 @@ sub create_user {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -178,7 +177,6 @@ sub create_users_with_array_input {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -243,7 +241,6 @@ sub create_users_with_list_input {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -315,7 +312,6 @@ sub delete_user {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -390,7 +386,6 @@ sub get_user_by_name {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('User', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -467,7 +462,6 @@ sub login_user {
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('string', $response);
|
||||
return $_response_object;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -523,7 +517,6 @@ sub logout_user {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@ -604,7 +597,6 @@ sub update_user {
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-04-09T21:05:22.902+02:00
|
||||
- Build date: 2016-04-11T16:59:06.544+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||
|
||||
## Requirements
|
||||
@ -127,25 +127,10 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
## petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- **write:pets**: modify pets in your account
|
||||
- **read:pets**: read your pets
|
||||
|
||||
## test_api_client_id
|
||||
## test_api_key_header
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_id
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_api_client_secret
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_secret
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
|
||||
## api_key
|
||||
@ -158,17 +143,32 @@ Class | Method | HTTP request | Description
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
## test_api_client_secret
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_secret
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_api_client_id
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_id
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
## test_api_key_header
|
||||
## petstore_auth
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- **write:pets**: modify pets in your account
|
||||
- **read:pets**: read your pets
|
||||
|
||||
|
||||
## Author
|
||||
|
@ -3,12 +3,12 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**photo_urls** | **string[]** | | [optional]
|
||||
**name** | **string** | | [optional]
|
||||
**tags** | [**\Swagger\Client\Model\Tag[]**](Tag.md) | | [optional]
|
||||
**id** | **int** | |
|
||||
**category** | **object** | | [optional]
|
||||
**tags** | [**\Swagger\Client\Model\Tag[]**](Tag.md) | | [optional]
|
||||
**status** | **string** | pet status in the store | [optional]
|
||||
**name** | **string** | | [optional]
|
||||
**photo_urls** | **string[]** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -268,12 +268,12 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
// Configure API key authorization: api_key
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||
@ -299,7 +299,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
@ -320,12 +320,12 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
// Configure API key authorization: api_key
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||
@ -351,7 +351,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
@ -372,12 +372,12 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
// Configure API key authorization: api_key
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||
@ -403,7 +403,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
|
@ -214,14 +214,14 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure API key authorization: test_api_key_query
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_query', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_query', 'BEARER');
|
||||
// Configure API key authorization: test_api_key_header
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_header', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_header', 'BEARER');
|
||||
// Configure API key authorization: test_api_key_query
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_query', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_query', 'BEARER');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||
$order_id = "order_id_example"; // string | ID of pet that needs to be fetched
|
||||
@ -247,7 +247,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_key_query](../README.md#test_api_key_query), [test_api_key_header](../README.md#test_api_key_header)
|
||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
|
@ -593,17 +593,17 @@ class PetApi
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@ -695,17 +695,17 @@ class PetApi
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@ -797,17 +797,17 @@ class PetApi
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
|
@ -506,16 +506,16 @@ class StoreApi
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query');
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$queryParams['test_api_key_query'] = $apiKey;
|
||||
$headerParams['test_api_key_header'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header');
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['test_api_key_header'] = $apiKey;
|
||||
$queryParams['test_api_key_query'] = $apiKey;
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
|
@ -57,12 +57,12 @@ class InlineResponse200 implements ArrayAccess
|
||||
* @var string[]
|
||||
*/
|
||||
static $swaggerTypes = array(
|
||||
'photo_urls' => 'string[]',
|
||||
'name' => 'string',
|
||||
'tags' => '\Swagger\Client\Model\Tag[]',
|
||||
'id' => 'int',
|
||||
'category' => 'object',
|
||||
'tags' => '\Swagger\Client\Model\Tag[]',
|
||||
'status' => 'string'
|
||||
'status' => 'string',
|
||||
'name' => 'string',
|
||||
'photo_urls' => 'string[]'
|
||||
);
|
||||
|
||||
static function swaggerTypes() {
|
||||
@ -74,12 +74,12 @@ class InlineResponse200 implements ArrayAccess
|
||||
* @var string[]
|
||||
*/
|
||||
static $attributeMap = array(
|
||||
'photo_urls' => 'photoUrls',
|
||||
'name' => 'name',
|
||||
'tags' => 'tags',
|
||||
'id' => 'id',
|
||||
'category' => 'category',
|
||||
'tags' => 'tags',
|
||||
'status' => 'status'
|
||||
'status' => 'status',
|
||||
'name' => 'name',
|
||||
'photo_urls' => 'photoUrls'
|
||||
);
|
||||
|
||||
static function attributeMap() {
|
||||
@ -91,12 +91,12 @@ class InlineResponse200 implements ArrayAccess
|
||||
* @var string[]
|
||||
*/
|
||||
static $setters = array(
|
||||
'photo_urls' => 'setPhotoUrls',
|
||||
'name' => 'setName',
|
||||
'tags' => 'setTags',
|
||||
'id' => 'setId',
|
||||
'category' => 'setCategory',
|
||||
'tags' => 'setTags',
|
||||
'status' => 'setStatus'
|
||||
'status' => 'setStatus',
|
||||
'name' => 'setName',
|
||||
'photo_urls' => 'setPhotoUrls'
|
||||
);
|
||||
|
||||
static function setters() {
|
||||
@ -108,12 +108,12 @@ class InlineResponse200 implements ArrayAccess
|
||||
* @var string[]
|
||||
*/
|
||||
static $getters = array(
|
||||
'photo_urls' => 'getPhotoUrls',
|
||||
'name' => 'getName',
|
||||
'tags' => 'getTags',
|
||||
'id' => 'getId',
|
||||
'category' => 'getCategory',
|
||||
'tags' => 'getTags',
|
||||
'status' => 'getStatus'
|
||||
'status' => 'getStatus',
|
||||
'name' => 'getName',
|
||||
'photo_urls' => 'getPhotoUrls'
|
||||
);
|
||||
|
||||
static function getters() {
|
||||
@ -121,15 +121,10 @@ class InlineResponse200 implements ArrayAccess
|
||||
}
|
||||
|
||||
/**
|
||||
* $photo_urls
|
||||
* @var string[]
|
||||
* $tags
|
||||
* @var \Swagger\Client\Model\Tag[]
|
||||
*/
|
||||
protected $photo_urls;
|
||||
/**
|
||||
* $name
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
protected $tags;
|
||||
/**
|
||||
* $id
|
||||
* @var int
|
||||
@ -140,16 +135,21 @@ class InlineResponse200 implements ArrayAccess
|
||||
* @var object
|
||||
*/
|
||||
protected $category;
|
||||
/**
|
||||
* $tags
|
||||
* @var \Swagger\Client\Model\Tag[]
|
||||
*/
|
||||
protected $tags;
|
||||
/**
|
||||
* $status pet status in the store
|
||||
* @var string
|
||||
*/
|
||||
protected $status;
|
||||
/**
|
||||
* $name
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
/**
|
||||
* $photo_urls
|
||||
* @var string[]
|
||||
*/
|
||||
protected $photo_urls;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -160,52 +160,32 @@ class InlineResponse200 implements ArrayAccess
|
||||
|
||||
|
||||
if ($data != null) {
|
||||
$this->photo_urls = $data["photo_urls"];
|
||||
$this->name = $data["name"];
|
||||
$this->tags = $data["tags"];
|
||||
$this->id = $data["id"];
|
||||
$this->category = $data["category"];
|
||||
$this->tags = $data["tags"];
|
||||
$this->status = $data["status"];
|
||||
$this->name = $data["name"];
|
||||
$this->photo_urls = $data["photo_urls"];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Gets photo_urls
|
||||
* @return string[]
|
||||
* Gets tags
|
||||
* @return \Swagger\Client\Model\Tag[]
|
||||
*/
|
||||
public function getPhotoUrls()
|
||||
public function getTags()
|
||||
{
|
||||
return $this->photo_urls;
|
||||
return $this->tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets photo_urls
|
||||
* @param string[] $photo_urls
|
||||
* Sets tags
|
||||
* @param \Swagger\Client\Model\Tag[] $tags
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhotoUrls($photo_urls)
|
||||
public function setTags($tags)
|
||||
{
|
||||
|
||||
$this->photo_urls = $photo_urls;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Gets name
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
* @param string $name
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
||||
$this->name = $name;
|
||||
$this->tags = $tags;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
@ -248,26 +228,6 @@ class InlineResponse200 implements ArrayAccess
|
||||
$this->category = $category;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Gets tags
|
||||
* @return \Swagger\Client\Model\Tag[]
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
return $this->tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets tags
|
||||
* @param \Swagger\Client\Model\Tag[] $tags
|
||||
* @return $this
|
||||
*/
|
||||
public function setTags($tags)
|
||||
{
|
||||
|
||||
$this->tags = $tags;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Gets status
|
||||
* @return string
|
||||
@ -291,6 +251,46 @@ class InlineResponse200 implements ArrayAccess
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Gets name
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
* @param string $name
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Gets photo_urls
|
||||
* @return string[]
|
||||
*/
|
||||
public function getPhotoUrls()
|
||||
{
|
||||
return $this->photo_urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets photo_urls
|
||||
* @param string[] $photo_urls
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhotoUrls($photo_urls)
|
||||
{
|
||||
|
||||
$this->photo_urls = $photo_urls;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
* @param integer $offset Offset
|
||||
|
@ -256,7 +256,7 @@ class ObjectSerializer
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
|
||||
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
|
||||
settype($data, $class);
|
||||
return $data;
|
||||
} elseif ($class === '\SplFileObject') {
|
||||
|
@ -3,9 +3,9 @@ This is a sample server Petstore server. You can find out more about Swagger at
|
||||
|
||||
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API verion: 1.0.0
|
||||
- Package version:
|
||||
- Build date: 2016-03-30T17:18:44.943+08:00
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-04-11T16:56:24.045+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
|
||||
|
||||
## Requirements.
|
||||
@ -20,9 +20,9 @@ If the python package is hosted on Github, you can install directly from Github
|
||||
```sh
|
||||
pip install git+https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git
|
||||
```
|
||||
(you may need to run the command with root permission: `sudo pip install git+https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git`)
|
||||
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git`)
|
||||
|
||||
Import the pacakge:
|
||||
Then import the package:
|
||||
```python
|
||||
import swagger_client
|
||||
```
|
||||
@ -36,19 +36,11 @@ python setup.py install --user
|
||||
```
|
||||
(or `sudo python setup.py install` to install the package for all users)
|
||||
|
||||
Import the pacakge:
|
||||
Then import the package:
|
||||
```python
|
||||
import swagger_client
|
||||
```
|
||||
|
||||
### Manual Installation
|
||||
|
||||
Download the latest release to the project folder (e.g. ./path/to/swagger_client) and import the package:
|
||||
|
||||
```python
|
||||
import path.to.swagger_client
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
@ -67,7 +59,7 @@ body = swagger_client.Pet() # Pet | Pet object that needs to be added to the sto
|
||||
|
||||
try:
|
||||
# Add a new pet to the store
|
||||
api_instance.add_pet(body=body);
|
||||
api_instance.add_pet(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->add_pet: %s\n" % e
|
||||
|
||||
@ -80,20 +72,20 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
*PetApi* | [**add_pet_using_byte_array**](docs/PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*PetApi* | [**add_pet_using_byte_array**](docs/PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
*PetApi* | [**get_pet_by_id_in_object**](docs/PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*PetApi* | [**get_pet_by_id_in_object**](docs/PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
*StoreApi* | [**find_orders_by_status**](docs/StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||
*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||
*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
|
||||
@ -112,6 +104,7 @@ Class | Method | HTTP request | Description
|
||||
- [Cat](docs/Cat.md)
|
||||
- [Category](docs/Category.md)
|
||||
- [Dog](docs/Dog.md)
|
||||
- [FormatTest](docs/FormatTest.md)
|
||||
- [InlineResponse200](docs/InlineResponse200.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
|
@ -3,7 +3,7 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **int** | | [optional]
|
||||
**name** | **int** | |
|
||||
**snake_case** | **int** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -1,17 +1,17 @@
|
||||
# swagger_client\PetApi
|
||||
# swagger_client.PetApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
@ -26,11 +26,10 @@ Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@ -41,7 +40,7 @@ body = swagger_client.Pet() # Pet | Pet object that needs to be added to the sto
|
||||
|
||||
try:
|
||||
# Add a new pet to the store
|
||||
api_instance.add_pet(body=body);
|
||||
api_instance.add_pet(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->add_pet: %s\n" % e
|
||||
```
|
||||
@ -76,11 +75,10 @@ Fake endpoint to test byte array in body parameter for adding a new pet to the s
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@ -91,7 +89,7 @@ body = 'B' # str | Pet object in the form of byte array (optional)
|
||||
|
||||
try:
|
||||
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
api_instance.add_pet_using_byte_array(body=body);
|
||||
api_instance.add_pet_using_byte_array(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->add_pet_using_byte_array: %s\n" % e
|
||||
```
|
||||
@ -126,11 +124,10 @@ Deletes a pet
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@ -142,7 +139,7 @@ api_key = 'api_key_example' # str | (optional)
|
||||
|
||||
try:
|
||||
# Deletes a pet
|
||||
api_instance.delete_pet(pet_id, api_key=api_key);
|
||||
api_instance.delete_pet(pet_id, api_key=api_key)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->delete_pet: %s\n" % e
|
||||
```
|
||||
@ -178,11 +175,10 @@ Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@ -193,7 +189,7 @@ status = ['available'] # list[str] | Status values that need to be considered fo
|
||||
|
||||
try:
|
||||
# Finds Pets by status
|
||||
api_response = api_instance.find_pets_by_status(status=status);
|
||||
api_response = api_instance.find_pets_by_status(status=status)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->find_pets_by_status: %s\n" % e
|
||||
@ -229,11 +225,10 @@ Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@ -244,7 +239,7 @@ tags = ['tags_example'] # list[str] | Tags to filter by (optional)
|
||||
|
||||
try:
|
||||
# Finds Pets by tags
|
||||
api_response = api_instance.find_pets_by_tags(tags=tags);
|
||||
api_response = api_instance.find_pets_by_tags(tags=tags)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->find_pets_by_tags: %s\n" % e
|
||||
@ -280,14 +275,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
@ -299,7 +293,7 @@ pet_id = 789 # int | ID of pet that needs to be fetched
|
||||
|
||||
try:
|
||||
# Find pet by ID
|
||||
api_response = api_instance.get_pet_by_id(pet_id);
|
||||
api_response = api_instance.get_pet_by_id(pet_id)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->get_pet_by_id: %s\n" % e
|
||||
@ -335,14 +329,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
@ -354,7 +347,7 @@ pet_id = 789 # int | ID of pet that needs to be fetched
|
||||
|
||||
try:
|
||||
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
api_response = api_instance.get_pet_by_id_in_object(pet_id);
|
||||
api_response = api_instance.get_pet_by_id_in_object(pet_id)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->get_pet_by_id_in_object: %s\n" % e
|
||||
@ -390,14 +383,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
@ -409,7 +401,7 @@ pet_id = 789 # int | ID of pet that needs to be fetched
|
||||
|
||||
try:
|
||||
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
api_response = api_instance.pet_pet_idtesting_byte_arraytrue_get(pet_id);
|
||||
api_response = api_instance.pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: %s\n" % e
|
||||
@ -445,11 +437,10 @@ Update an existing pet
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@ -460,7 +451,7 @@ body = swagger_client.Pet() # Pet | Pet object that needs to be added to the sto
|
||||
|
||||
try:
|
||||
# Update an existing pet
|
||||
api_instance.update_pet(body=body);
|
||||
api_instance.update_pet(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->update_pet: %s\n" % e
|
||||
```
|
||||
@ -495,11 +486,10 @@ Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@ -512,7 +502,7 @@ status = 'status_example' # str | Updated status of the pet (optional)
|
||||
|
||||
try:
|
||||
# Updates a pet in the store with form data
|
||||
api_instance.update_pet_with_form(pet_id, name=name, status=status);
|
||||
api_instance.update_pet_with_form(pet_id, name=name, status=status)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->update_pet_with_form: %s\n" % e
|
||||
```
|
||||
@ -549,11 +539,10 @@ uploads an image
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@ -566,7 +555,7 @@ file = '/path/to/file.txt' # file | file to upload (optional)
|
||||
|
||||
try:
|
||||
# uploads an image
|
||||
api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file);
|
||||
api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->upload_file: %s\n" % e
|
||||
```
|
||||
|
@ -1,4 +1,4 @@
|
||||
# swagger_client\StoreApi
|
||||
# swagger_client.StoreApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
@ -7,7 +7,7 @@ Method | HTTP request | Description
|
||||
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
@ -21,11 +21,10 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.StoreApi()
|
||||
@ -33,7 +32,7 @@ order_id = 'order_id_example' # str | ID of the order that needs to be deleted
|
||||
|
||||
try:
|
||||
# Delete purchase order by ID
|
||||
api_instance.delete_order(order_id);
|
||||
api_instance.delete_order(order_id)
|
||||
except ApiException as e:
|
||||
print "Exception when calling StoreApi->delete_order: %s\n" % e
|
||||
```
|
||||
@ -68,18 +67,17 @@ A single status value can be provided as a string
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: test_api_client_id
|
||||
swagger_client.configuration.api_key['x-test_api_client_id'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['x-test_api_client_id'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||
# Configure API key authorization: test_api_client_secret
|
||||
swagger_client.configuration.api_key['x-test_api_client_secret'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['x-test_api_client_secret'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||
|
||||
@ -89,7 +87,7 @@ status = 'placed' # str | Status value that needs to be considered for query (op
|
||||
|
||||
try:
|
||||
# Finds orders by status
|
||||
api_response = api_instance.find_orders_by_status(status=status);
|
||||
api_response = api_instance.find_orders_by_status(status=status)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling StoreApi->find_orders_by_status: %s\n" % e
|
||||
@ -125,14 +123,13 @@ Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||
|
||||
@ -141,7 +138,7 @@ api_instance = swagger_client.StoreApi()
|
||||
|
||||
try:
|
||||
# Returns pet inventories by status
|
||||
api_response = api_instance.get_inventory();
|
||||
api_response = api_instance.get_inventory()
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling StoreApi->get_inventory: %s\n" % e
|
||||
@ -174,14 +171,13 @@ Returns an arbitrary object which is actually a map of status codes to quantitie
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||
|
||||
@ -190,7 +186,7 @@ api_instance = swagger_client.StoreApi()
|
||||
|
||||
try:
|
||||
# Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
api_response = api_instance.get_inventory_in_object();
|
||||
api_response = api_instance.get_inventory_in_object()
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling StoreApi->get_inventory_in_object: %s\n" % e
|
||||
@ -223,18 +219,17 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: test_api_key_header
|
||||
swagger_client.configuration.api_key['test_api_key_header'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['test_api_key_header'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['test_api_key_header'] = 'BEARER'
|
||||
# Configure API key authorization: test_api_key_query
|
||||
swagger_client.configuration.api_key['test_api_key_query'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['test_api_key_query'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['test_api_key_query'] = 'BEARER'
|
||||
|
||||
@ -244,7 +239,7 @@ order_id = 'order_id_example' # str | ID of pet that needs to be fetched
|
||||
|
||||
try:
|
||||
# Find purchase order by ID
|
||||
api_response = api_instance.get_order_by_id(order_id);
|
||||
api_response = api_instance.get_order_by_id(order_id)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling StoreApi->get_order_by_id: %s\n" % e
|
||||
@ -280,18 +275,17 @@ Place an order for a pet
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: test_api_client_id
|
||||
swagger_client.configuration.api_key['x-test_api_client_id'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['x-test_api_client_id'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||
# Configure API key authorization: test_api_client_secret
|
||||
swagger_client.configuration.api_key['x-test_api_client_secret'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['x-test_api_client_secret'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||
|
||||
@ -301,7 +295,7 @@ body = swagger_client.Order() # Order | order placed for purchasing the pet (opt
|
||||
|
||||
try:
|
||||
# Place an order for a pet
|
||||
api_response = api_instance.place_order(body=body);
|
||||
api_response = api_instance.place_order(body=body)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling StoreApi->place_order: %s\n" % e
|
||||
|
@ -1,4 +1,4 @@
|
||||
# swagger_client\UserApi
|
||||
# swagger_client.UserApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
@ -23,11 +23,10 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.UserApi()
|
||||
@ -35,7 +34,7 @@ body = swagger_client.User() # User | Created user object (optional)
|
||||
|
||||
try:
|
||||
# Create user
|
||||
api_instance.create_user(body=body);
|
||||
api_instance.create_user(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling UserApi->create_user: %s\n" % e
|
||||
```
|
||||
@ -70,11 +69,10 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.UserApi()
|
||||
@ -82,7 +80,7 @@ body = [swagger_client.User()] # list[User] | List of user object (optional)
|
||||
|
||||
try:
|
||||
# Creates list of users with given input array
|
||||
api_instance.create_users_with_array_input(body=body);
|
||||
api_instance.create_users_with_array_input(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling UserApi->create_users_with_array_input: %s\n" % e
|
||||
```
|
||||
@ -117,11 +115,10 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.UserApi()
|
||||
@ -129,7 +126,7 @@ body = [swagger_client.User()] # list[User] | List of user object (optional)
|
||||
|
||||
try:
|
||||
# Creates list of users with given input array
|
||||
api_instance.create_users_with_list_input(body=body);
|
||||
api_instance.create_users_with_list_input(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling UserApi->create_users_with_list_input: %s\n" % e
|
||||
```
|
||||
@ -164,11 +161,10 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure HTTP basic authorization: test_http_basic
|
||||
swagger_client.configuration.username = 'YOUR_USERNAME'
|
||||
@ -180,7 +176,7 @@ username = 'username_example' # str | The name that needs to be deleted
|
||||
|
||||
try:
|
||||
# Delete user
|
||||
api_instance.delete_user(username);
|
||||
api_instance.delete_user(username)
|
||||
except ApiException as e:
|
||||
print "Exception when calling UserApi->delete_user: %s\n" % e
|
||||
```
|
||||
@ -215,11 +211,10 @@ Get user by user name
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.UserApi()
|
||||
@ -227,7 +222,7 @@ username = 'username_example' # str | The name that needs to be fetched. Use use
|
||||
|
||||
try:
|
||||
# Get user by user name
|
||||
api_response = api_instance.get_user_by_name(username);
|
||||
api_response = api_instance.get_user_by_name(username)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling UserApi->get_user_by_name: %s\n" % e
|
||||
@ -263,11 +258,10 @@ Logs user into the system
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.UserApi()
|
||||
@ -276,7 +270,7 @@ password = 'password_example' # str | The password for login in clear text (opti
|
||||
|
||||
try:
|
||||
# Logs user into the system
|
||||
api_response = api_instance.login_user(username=username, password=password);
|
||||
api_response = api_instance.login_user(username=username, password=password)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling UserApi->login_user: %s\n" % e
|
||||
@ -313,18 +307,17 @@ Logs out current logged in user session
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.UserApi()
|
||||
|
||||
try:
|
||||
# Logs out current logged in user session
|
||||
api_instance.logout_user();
|
||||
api_instance.logout_user()
|
||||
except ApiException as e:
|
||||
print "Exception when calling UserApi->logout_user: %s\n" % e
|
||||
```
|
||||
@ -356,11 +349,10 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.UserApi()
|
||||
@ -369,7 +361,7 @@ body = swagger_client.User() # User | Updated user object (optional)
|
||||
|
||||
try:
|
||||
# Updated user
|
||||
api_instance.update_user(username, body=body);
|
||||
api_instance.update_user(username, body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling UserApi->update_user: %s\n" % e
|
||||
```
|
||||
|
@ -28,7 +28,7 @@ setup(
|
||||
packages=find_packages(),
|
||||
include_package_data=True,
|
||||
long_description="""\
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
"""
|
||||
)
|
||||
|
||||
|
@ -6,7 +6,7 @@ Home-page: UNKNOWN
|
||||
Author: UNKNOWN
|
||||
Author-email: apiteam@swagger.io
|
||||
License: UNKNOWN
|
||||
Description: This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
Description: This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
|
||||
Keywords: Swagger,Swagger Petstore
|
||||
Platform: UNKNOWN
|
||||
|
@ -5,6 +5,7 @@ from .models.animal import Animal
|
||||
from .models.cat import Cat
|
||||
from .models.category import Category
|
||||
from .models.dog import Dog
|
||||
from .models.format_test import FormatTest
|
||||
from .models.inline_response_200 import InlineResponse200
|
||||
from .models.model_200_response import Model200Response
|
||||
from .models.model_return import ModelReturn
|
||||
|
@ -154,7 +154,7 @@ class PetApi(object):
|
||||
del params['kwargs']
|
||||
|
||||
|
||||
resource_path = '/pet?testing_byte_array=true'.replace('{format}', 'json')
|
||||
resource_path = '/pet?testing_byte_array=true'.replace('{format}', 'json')
|
||||
path_params = {}
|
||||
|
||||
query_params = {}
|
||||
@ -536,7 +536,7 @@ class PetApi(object):
|
||||
if ('pet_id' not in params) or (params['pet_id'] is None):
|
||||
raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id_in_object`")
|
||||
|
||||
resource_path = '/pet/{petId}?response=inline_arbitrary_object'.replace('{format}', 'json')
|
||||
resource_path = '/pet/{petId}?response=inline_arbitrary_object'.replace('{format}', 'json')
|
||||
path_params = {}
|
||||
if 'pet_id' in params:
|
||||
path_params['petId'] = params['pet_id']
|
||||
@ -613,7 +613,7 @@ class PetApi(object):
|
||||
if ('pet_id' not in params) or (params['pet_id'] is None):
|
||||
raise ValueError("Missing the required parameter `pet_id` when calling `pet_pet_idtesting_byte_arraytrue_get`")
|
||||
|
||||
resource_path = '/pet/{petId}?testing_byte_array=true'.replace('{format}', 'json')
|
||||
resource_path = '/pet/{petId}?testing_byte_array=true'.replace('{format}', 'json')
|
||||
path_params = {}
|
||||
if 'pet_id' in params:
|
||||
path_params['petId'] = params['pet_id']
|
||||
|
@ -301,7 +301,7 @@ class StoreApi(object):
|
||||
del params['kwargs']
|
||||
|
||||
|
||||
resource_path = '/store/inventory?response=arbitrary_object'.replace('{format}', 'json')
|
||||
resource_path = '/store/inventory?response=arbitrary_object'.replace('{format}', 'json')
|
||||
path_params = {}
|
||||
|
||||
query_params = {}
|
||||
|
@ -5,6 +5,7 @@ from .animal import Animal
|
||||
from .cat import Cat
|
||||
from .category import Category
|
||||
from .dog import Dog
|
||||
from .format_test import FormatTest
|
||||
from .inline_response_200 import InlineResponse200
|
||||
from .model_200_response import Model200Response
|
||||
from .model_return import ModelReturn
|
||||
|
@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-04-09T17:50:53.781+08:00
|
||||
- Build date: 2016-04-11T17:03:41.311+08:00
|
||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
@ -114,6 +114,7 @@ Class | Method | HTTP request | Description
|
||||
- [Petstore::Cat](docs/Cat.md)
|
||||
- [Petstore::Category](docs/Category.md)
|
||||
- [Petstore::Dog](docs/Dog.md)
|
||||
- [Petstore::FormatTest](docs/FormatTest.md)
|
||||
- [Petstore::InlineResponse200](docs/InlineResponse200.md)
|
||||
- [Petstore::Model200Response](docs/Model200Response.md)
|
||||
- [Petstore::ModelReturn](docs/ModelReturn.md)
|
||||
|
@ -3,7 +3,7 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Integer** | | [optional]
|
||||
**name** | **Integer** | |
|
||||
**snake_case** | **Integer** | | [optional]
|
||||
|
||||
|
||||
|
@ -25,6 +25,7 @@ require 'petstore/models/animal'
|
||||
require 'petstore/models/cat'
|
||||
require 'petstore/models/category'
|
||||
require 'petstore/models/dog'
|
||||
require 'petstore/models/format_test'
|
||||
require 'petstore/models/inline_response_200'
|
||||
require 'petstore/models/model_200_response'
|
||||
require 'petstore/models/model_return'
|
||||
|
@ -210,7 +210,7 @@
|
||||
<joda-version>1.2</joda-version>
|
||||
<joda-time-version>2.2</joda-time-version>
|
||||
<jersey-version>1.19</jersey-version>
|
||||
<swagger-core-version>1.5.7</swagger-core-version>
|
||||
<swagger-core-version>1.5.8</swagger-core-version>
|
||||
<jersey-async-version>1.0.5</jersey-async-version>
|
||||
<maven-plugin.version>1.0.0</maven-plugin.version>
|
||||
<jackson-version>2.4.2</jackson-version>
|
||||
|
@ -23,7 +23,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value
|
||||
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
@ -33,7 +32,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def addPet (body: Pet) = {
|
||||
// create path and map variables
|
||||
val path = "/pet".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json", "application/xml", "application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -45,9 +43,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = body
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -56,13 +51,11 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -70,7 +63,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
@ -79,8 +71,7 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
*/
|
||||
def addPetUsingByteArray (body: String) = {
|
||||
// create path and map variables
|
||||
val path = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json")
|
||||
|
||||
val path = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json")
|
||||
val contentTypes = List("application/json", "application/xml", "application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -92,9 +83,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = body
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -103,13 +91,11 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -117,7 +103,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
@ -130,7 +115,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -141,11 +125,8 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
headerParams += "api_key" -> apiKey
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -154,13 +135,11 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -168,7 +147,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
@ -178,7 +156,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def findPetsByStatus (status: List[String] /* = available */) : Option[List[Pet]] = {
|
||||
// create path and map variables
|
||||
val path = "/pet/findByStatus".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -188,12 +165,9 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val formParams = new HashMap[String, String]
|
||||
|
||||
|
||||
|
||||
if(String.valueOf(status) != "null") queryParams += "status" -> status.toString
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -202,14 +176,12 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -217,7 +189,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
@ -227,7 +198,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def findPetsByTags (tags: List[String]) : Option[List[Pet]] = {
|
||||
// create path and map variables
|
||||
val path = "/pet/findByTags".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -237,12 +207,9 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val formParams = new HashMap[String, String]
|
||||
|
||||
|
||||
|
||||
if(String.valueOf(tags) != "null") queryParams += "tags" -> tags.toString
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -251,14 +218,12 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -266,7 +231,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
@ -278,7 +242,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -290,9 +253,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -301,14 +261,12 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "", classOf[Pet]).asInstanceOf[Pet])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -316,7 +274,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -325,8 +282,7 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
*/
|
||||
def getPetByIdInObject (petId: Long) : Option[InlineResponse200] = {
|
||||
// create path and map variables
|
||||
val path = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||
|
||||
val path = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
@ -340,9 +296,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -351,14 +304,12 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "", classOf[InlineResponse200]).asInstanceOf[InlineResponse200])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -366,7 +317,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -375,8 +325,7 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
*/
|
||||
def petPetIdtestingByteArraytrueGet (petId: Long) : Option[String] = {
|
||||
// create path and map variables
|
||||
val path = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||
|
||||
val path = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
@ -390,9 +339,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -401,14 +347,12 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "", classOf[String]).asInstanceOf[String])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -416,7 +360,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
@ -426,7 +369,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def updatePet (body: Pet) = {
|
||||
// create path and map variables
|
||||
val path = "/pet".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json", "application/xml", "application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -438,9 +380,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = body
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -449,13 +388,11 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -463,7 +400,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
@ -477,7 +413,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("application/x-www-form-urlencoded", "application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -489,9 +424,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -506,13 +438,11 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
else {
|
||||
formParams += "name" -> name.toString()
|
||||
formParams += "status" -> status.toString()
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -520,7 +450,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
@ -534,7 +463,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("multipart/form-data", "application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -546,9 +474,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -564,13 +489,11 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
else {
|
||||
formParams += "additionalMetadata" -> additionalMetadata.toString()
|
||||
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -578,5 +501,4 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value
|
||||
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
@ -33,7 +32,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -45,9 +43,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -56,13 +51,11 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -70,7 +63,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
@ -80,7 +72,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def findOrdersByStatus (status: String /* = placed */) : Option[List[Order]] = {
|
||||
// create path and map variables
|
||||
val path = "/store/findByStatus".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -90,12 +81,9 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val formParams = new HashMap[String, String]
|
||||
|
||||
|
||||
|
||||
if(String.valueOf(status) != "null") queryParams += "status" -> status.toString
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -104,14 +92,12 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "array", classOf[Order]).asInstanceOf[List[Order]])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -119,7 +105,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
@ -128,7 +113,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def getInventory () : Option[Map[String, Integer]] = {
|
||||
// create path and map variables
|
||||
val path = "/store/inventory".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -140,9 +124,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -151,14 +132,12 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "map", classOf[Integer]).asInstanceOf[Map[String, Integer]])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -166,7 +145,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
* Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
@ -174,8 +152,7 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
*/
|
||||
def getInventoryInObject () : Option[Any] = {
|
||||
// create path and map variables
|
||||
val path = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json")
|
||||
|
||||
val path = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json")
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -187,9 +164,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -198,14 +172,12 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "", classOf[Any]).asInstanceOf[Any])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -213,10 +185,9 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return Order
|
||||
*/
|
||||
@ -225,7 +196,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -237,9 +207,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -248,14 +215,12 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -263,7 +228,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
@ -273,7 +237,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def placeOrder (body: Order) : Option[Order] = {
|
||||
// create path and map variables
|
||||
val path = "/store/order".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -285,9 +248,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = body
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -296,14 +256,12 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -311,5 +269,4 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value
|
||||
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
@ -31,7 +30,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def createUser (body: User) = {
|
||||
// create path and map variables
|
||||
val path = "/user".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -43,9 +41,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = body
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -54,13 +49,11 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -68,7 +61,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
@ -78,7 +70,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def createUsersWithArrayInput (body: List[User]) = {
|
||||
// create path and map variables
|
||||
val path = "/user/createWithArray".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -90,9 +81,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = body
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -101,13 +89,11 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -115,7 +101,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
@ -125,7 +110,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def createUsersWithListInput (body: List[User]) = {
|
||||
// create path and map variables
|
||||
val path = "/user/createWithList".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -137,9 +121,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = body
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -148,13 +129,11 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -162,7 +141,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
@ -174,7 +152,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -186,9 +163,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -197,13 +171,11 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -211,7 +183,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
@ -223,7 +194,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -235,9 +205,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -246,14 +213,12 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "", classOf[User]).asInstanceOf[User])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -261,7 +226,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
@ -272,7 +236,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def loginUser (username: String, password: String) : Option[String] = {
|
||||
// create path and map variables
|
||||
val path = "/user/login".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -282,13 +245,10 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val formParams = new HashMap[String, String]
|
||||
|
||||
|
||||
|
||||
if(String.valueOf(username) != "null") queryParams += "username" -> username.toString
|
||||
if(String.valueOf(password) != "null") queryParams += "password" -> password.toString
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -297,14 +257,12 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
Some(ApiInvoker.deserialize(s, "", classOf[String]).asInstanceOf[String])
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -312,7 +270,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
@ -321,7 +278,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
def logoutUser () = {
|
||||
// create path and map variables
|
||||
val path = "/user/logout".replaceAll("\\{format\\}","json")
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -333,9 +289,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = null
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -344,13 +297,11 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -358,7 +309,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
@ -371,7 +321,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
||||
|
||||
|
||||
|
||||
val contentTypes = List("application/json")
|
||||
val contentType = contentTypes(0)
|
||||
|
||||
@ -383,9 +332,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var postBody: AnyRef = body
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -394,13 +340,11 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
postBody = mp
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
|
||||
case s: String =>
|
||||
|
||||
case _ => None
|
||||
}
|
||||
} catch {
|
||||
@ -408,5 +352,4 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2",
|
||||
case ex: ApiException => throw ex
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,4 +6,3 @@ package io.swagger.client.model
|
||||
case class Category (
|
||||
id: Long,
|
||||
name: String)
|
||||
|
||||
|
@ -11,4 +11,3 @@ case class InlineResponse200 (
|
||||
status: String,
|
||||
name: String,
|
||||
photoUrls: List[String])
|
||||
|
||||
|
@ -5,4 +5,3 @@ package io.swagger.client.model
|
||||
|
||||
case class Model200Response (
|
||||
name: Integer)
|
||||
|
||||
|
@ -5,4 +5,3 @@ package io.swagger.client.model
|
||||
|
||||
case class ModelReturn (
|
||||
_return: Integer)
|
||||
|
||||
|
@ -4,5 +4,5 @@ package io.swagger.client.model
|
||||
|
||||
|
||||
case class Name (
|
||||
name: Integer)
|
||||
|
||||
name: Integer,
|
||||
snakeCase: Integer)
|
||||
|
@ -12,4 +12,3 @@ case class Order (
|
||||
/* Order Status */
|
||||
status: String,
|
||||
complete: Boolean)
|
||||
|
||||
|
@ -11,4 +11,3 @@ case class Pet (
|
||||
tags: List[Tag],
|
||||
/* pet status in the store */
|
||||
status: String)
|
||||
|
||||
|
@ -5,4 +5,3 @@ package io.swagger.client.model
|
||||
|
||||
case class SpecialModelName (
|
||||
specialPropertyName: Long)
|
||||
|
||||
|
@ -6,4 +6,3 @@ package io.swagger.client.model
|
||||
case class Tag (
|
||||
id: Long,
|
||||
name: String)
|
||||
|
||||
|
@ -13,4 +13,3 @@ case class User (
|
||||
phone: String,
|
||||
/* User Status */
|
||||
userStatus: Integer)
|
||||
|
||||
|
@ -12,7 +12,6 @@ import PromiseKit
|
||||
|
||||
public class PetAPI: APIBase {
|
||||
/**
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
- parameter body: (body) Pet object that needs to be added to the store (optional)
|
||||
@ -25,7 +24,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
- parameter body: (body) Pet object that needs to be added to the store (optional)
|
||||
@ -44,9 +42,7 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
- POST /pet
|
||||
-
|
||||
- OAuth:
|
||||
@ -60,7 +56,6 @@ public class PetAPI: APIBase {
|
||||
public class func addPetWithRequestBuilder(body body: Pet?) -> RequestBuilder<Void> {
|
||||
let path = "/pet"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let parameters = body?.encodeToJSON() as? [String:AnyObject]
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
@ -69,7 +64,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
|
||||
- parameter body: (body) Pet object in the form of byte array (optional)
|
||||
@ -82,7 +76,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
|
||||
- parameter body: (body) Pet object in the form of byte array (optional)
|
||||
@ -101,10 +94,8 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
|
||||
- POST /pet?testing_byte_array=true
|
||||
- POST /pet?testing_byte_array=true
|
||||
-
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
@ -115,9 +106,8 @@ public class PetAPI: APIBase {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
public class func addPetUsingByteArrayWithRequestBuilder(body body: String?) -> RequestBuilder<Void> {
|
||||
let path = "/pet?testing_byte_array=true"
|
||||
let path = "/pet?testing_byte_array=true"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let parameters = body?.encodeToJSON() as? [String:AnyObject]
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
@ -126,7 +116,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Deletes a pet
|
||||
|
||||
- parameter petId: (path) Pet id to delete
|
||||
@ -139,7 +128,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Deletes a pet
|
||||
|
||||
- parameter petId: (path) Pet id to delete
|
||||
@ -158,9 +146,7 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Deletes a pet
|
||||
|
||||
- DELETE /pet/{petId}
|
||||
-
|
||||
- OAuth:
|
||||
@ -185,7 +171,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
- parameter status: (query) Status values that need to be considered for query (optional, default to available)
|
||||
@ -198,7 +183,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
- parameter status: (query) Status values that need to be considered for query (optional, default to available)
|
||||
@ -217,28 +201,26 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
- GET /pet/findByStatus
|
||||
- Multiple status values can be provided with comma separated strings
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- examples: [{contentType=application/json, example=[ {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
- examples: [{example=[ {
|
||||
"tags" : [ {
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 123456789,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
} ],
|
||||
"status" : "aeiou"
|
||||
} ]}, {contentType=application/xml, example=<Pet>
|
||||
"status" : "aeiou",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
} ], contentType=application/json}, {example=<Pet>
|
||||
<id>123456</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@ -247,21 +229,21 @@ public class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>string</status>
|
||||
</Pet>}]
|
||||
- examples: [{contentType=application/json, example=[ {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}]
|
||||
- examples: [{example=[ {
|
||||
"tags" : [ {
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 123456789,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
} ],
|
||||
"status" : "aeiou"
|
||||
} ]}, {contentType=application/xml, example=<Pet>
|
||||
"status" : "aeiou",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
} ], contentType=application/json}, {example=<Pet>
|
||||
<id>123456</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@ -270,7 +252,7 @@ public class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>string</status>
|
||||
</Pet>}]
|
||||
</Pet>, contentType=application/xml}]
|
||||
|
||||
- parameter status: (query) Status values that need to be considered for query (optional, default to available)
|
||||
|
||||
@ -291,7 +273,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
- parameter tags: (query) Tags to filter by (optional)
|
||||
@ -304,7 +285,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
- parameter tags: (query) Tags to filter by (optional)
|
||||
@ -323,28 +303,26 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
- GET /pet/findByTags
|
||||
- Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- examples: [{contentType=application/json, example=[ {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
- examples: [{example=[ {
|
||||
"tags" : [ {
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 123456789,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
} ],
|
||||
"status" : "aeiou"
|
||||
} ]}, {contentType=application/xml, example=<Pet>
|
||||
"status" : "aeiou",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
} ], contentType=application/json}, {example=<Pet>
|
||||
<id>123456</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@ -353,21 +331,21 @@ public class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>string</status>
|
||||
</Pet>}]
|
||||
- examples: [{contentType=application/json, example=[ {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}]
|
||||
- examples: [{example=[ {
|
||||
"tags" : [ {
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 123456789,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
} ],
|
||||
"status" : "aeiou"
|
||||
} ]}, {contentType=application/xml, example=<Pet>
|
||||
"status" : "aeiou",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
} ], contentType=application/json}, {example=<Pet>
|
||||
<id>123456</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@ -376,7 +354,7 @@ public class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>string</status>
|
||||
</Pet>}]
|
||||
</Pet>, contentType=application/xml}]
|
||||
|
||||
- parameter tags: (query) Tags to filter by (optional)
|
||||
|
||||
@ -397,7 +375,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Find pet by ID
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
@ -410,7 +387,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Find pet by ID
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
@ -429,31 +405,29 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Find pet by ID
|
||||
|
||||
- GET /pet/{petId}
|
||||
- Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- examples: [{contentType=application/json, example={
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- examples: [{example={
|
||||
"tags" : [ {
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 123456789,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
} ],
|
||||
"status" : "aeiou"
|
||||
}}, {contentType=application/xml, example=<Pet>
|
||||
"status" : "aeiou",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
}, contentType=application/json}, {example=<Pet>
|
||||
<id>123456</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@ -462,21 +436,21 @@ public class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>string</status>
|
||||
</Pet>}]
|
||||
- examples: [{contentType=application/json, example={
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}]
|
||||
- examples: [{example={
|
||||
"tags" : [ {
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 123456789,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
} ],
|
||||
"status" : "aeiou"
|
||||
}}, {contentType=application/xml, example=<Pet>
|
||||
"status" : "aeiou",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
}, contentType=application/json}, {example=<Pet>
|
||||
<id>123456</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@ -485,7 +459,7 @@ public class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>string</status>
|
||||
</Pet>}]
|
||||
</Pet>, contentType=application/xml}]
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
|
||||
@ -505,7 +479,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
@ -518,7 +491,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
@ -537,58 +509,56 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
|
||||
- GET /pet/{petId}?response=inline_arbitrary_object
|
||||
- GET /pet/{petId}?response=inline_arbitrary_object
|
||||
- Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- examples: [{contentType=application/json, example={
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- examples: [{example={
|
||||
"id" : 123456789,
|
||||
"category" : "{}",
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"status" : "aeiou"
|
||||
}}, {contentType=application/xml, example=<null>
|
||||
<photoUrls>string</photoUrls>
|
||||
<name>doggie</name>
|
||||
"category" : "{}",
|
||||
"status" : "aeiou",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
}, contentType=application/json}, {example=<null>
|
||||
<id>123456</id>
|
||||
<category>not implemented io.swagger.models.properties.ObjectProperty@37ff6855</category>
|
||||
<status>string</status>
|
||||
</null>}]
|
||||
- examples: [{contentType=application/json, example={
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
"id" : 123456789,
|
||||
"category" : "{}",
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 123456789
|
||||
} ],
|
||||
"status" : "aeiou"
|
||||
}}, {contentType=application/xml, example=<null>
|
||||
<photoUrls>string</photoUrls>
|
||||
<name>doggie</name>
|
||||
<photoUrls>string</photoUrls>
|
||||
</null>, contentType=application/xml}]
|
||||
- examples: [{example={
|
||||
"id" : 123456789,
|
||||
"tags" : [ {
|
||||
"id" : 123456789,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"category" : "{}",
|
||||
"status" : "aeiou",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
}, contentType=application/json}, {example=<null>
|
||||
<id>123456</id>
|
||||
<category>not implemented io.swagger.models.properties.ObjectProperty@37ff6855</category>
|
||||
<status>string</status>
|
||||
</null>}]
|
||||
<name>doggie</name>
|
||||
<photoUrls>string</photoUrls>
|
||||
</null>, contentType=application/xml}]
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
|
||||
- returns: RequestBuilder<InlineResponse200>
|
||||
*/
|
||||
public class func getPetByIdInObjectWithRequestBuilder(petId petId: Int64) -> RequestBuilder<InlineResponse200> {
|
||||
var path = "/pet/{petId}?response=inline_arbitrary_object"
|
||||
var path = "/pet/{petId}?response=inline_arbitrary_object"
|
||||
path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
@ -601,7 +571,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
@ -614,7 +583,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
@ -633,26 +601,24 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
|
||||
- GET /pet/{petId}?testing_byte_array=true
|
||||
- GET /pet/{petId}?testing_byte_array=true
|
||||
- Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e}]
|
||||
- examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e}]
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- examples: [{example="", contentType=application/json}, {example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e, contentType=application/xml}]
|
||||
- examples: [{example="", contentType=application/json}, {example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e, contentType=application/xml}]
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be fetched
|
||||
|
||||
- returns: RequestBuilder<String>
|
||||
*/
|
||||
public class func petPetIdtestingByteArraytrueGetWithRequestBuilder(petId petId: Int64) -> RequestBuilder<String> {
|
||||
var path = "/pet/{petId}?testing_byte_array=true"
|
||||
var path = "/pet/{petId}?testing_byte_array=true"
|
||||
path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
@ -665,7 +631,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Update an existing pet
|
||||
|
||||
- parameter body: (body) Pet object that needs to be added to the store (optional)
|
||||
@ -678,7 +643,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Update an existing pet
|
||||
|
||||
- parameter body: (body) Pet object that needs to be added to the store (optional)
|
||||
@ -697,9 +661,7 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Update an existing pet
|
||||
|
||||
- PUT /pet
|
||||
-
|
||||
- OAuth:
|
||||
@ -713,7 +675,6 @@ public class PetAPI: APIBase {
|
||||
public class func updatePetWithRequestBuilder(body body: Pet?) -> RequestBuilder<Void> {
|
||||
let path = "/pet"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let parameters = body?.encodeToJSON() as? [String:AnyObject]
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
@ -722,7 +683,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be updated
|
||||
@ -737,7 +697,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be updated
|
||||
@ -758,9 +717,7 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
- POST /pet/{petId}
|
||||
-
|
||||
- OAuth:
|
||||
@ -790,7 +747,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
uploads an image
|
||||
|
||||
- parameter petId: (path) ID of pet to update
|
||||
@ -805,7 +761,6 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
uploads an image
|
||||
|
||||
- parameter petId: (path) ID of pet to update
|
||||
@ -826,9 +781,7 @@ public class PetAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
uploads an image
|
||||
|
||||
- POST /pet/{petId}/uploadImage
|
||||
-
|
||||
- OAuth:
|
||||
|
@ -12,7 +12,6 @@ import PromiseKit
|
||||
|
||||
public class StoreAPI: APIBase {
|
||||
/**
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
- parameter orderId: (path) ID of the order that needs to be deleted
|
||||
@ -25,7 +24,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
- parameter orderId: (path) ID of the order that needs to be deleted
|
||||
@ -44,9 +42,7 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
- DELETE /store/order/{orderId}
|
||||
- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
@ -68,7 +64,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds orders by status
|
||||
|
||||
- parameter status: (query) Status value that needs to be considered for query (optional, default to placed)
|
||||
@ -81,7 +76,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds orders by status
|
||||
|
||||
- parameter status: (query) Status value that needs to be considered for query (optional, default to placed)
|
||||
@ -100,9 +94,7 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Finds orders by status
|
||||
|
||||
- GET /store/findByStatus
|
||||
- A single status value can be provided as a string
|
||||
- API Key:
|
||||
@ -111,36 +103,36 @@ public class StoreAPI: APIBase {
|
||||
- API Key:
|
||||
- type: apiKey x-test_api_client_secret
|
||||
- name: test_api_client_secret
|
||||
- examples: [{contentType=application/json, example=[ {
|
||||
"petId" : 123456789,
|
||||
"quantity" : 123,
|
||||
- examples: [{example=[ {
|
||||
"id" : 123456789,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000",
|
||||
"petId" : 123456789,
|
||||
"complete" : true,
|
||||
"status" : "aeiou"
|
||||
} ]}, {contentType=application/xml, example=<Order>
|
||||
"status" : "aeiou",
|
||||
"quantity" : 123,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000"
|
||||
} ], contentType=application/json}, {example=<Order>
|
||||
<id>123456</id>
|
||||
<petId>123456</petId>
|
||||
<quantity>0</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>string</status>
|
||||
<complete>true</complete>
|
||||
</Order>}]
|
||||
- examples: [{contentType=application/json, example=[ {
|
||||
"petId" : 123456789,
|
||||
"quantity" : 123,
|
||||
</Order>, contentType=application/xml}]
|
||||
- examples: [{example=[ {
|
||||
"id" : 123456789,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000",
|
||||
"petId" : 123456789,
|
||||
"complete" : true,
|
||||
"status" : "aeiou"
|
||||
} ]}, {contentType=application/xml, example=<Order>
|
||||
"status" : "aeiou",
|
||||
"quantity" : 123,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000"
|
||||
} ], contentType=application/json}, {example=<Order>
|
||||
<id>123456</id>
|
||||
<petId>123456</petId>
|
||||
<quantity>0</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>string</status>
|
||||
<complete>true</complete>
|
||||
</Order>}]
|
||||
</Order>, contentType=application/xml}]
|
||||
|
||||
- parameter status: (query) Status value that needs to be considered for query (optional, default to placed)
|
||||
|
||||
@ -161,7 +153,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
@ -173,7 +164,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
- returns: Promise<[String:Int32]>
|
||||
@ -191,20 +181,18 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
- GET /store/inventory
|
||||
- Returns a map of status codes to quantities
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- examples: [{contentType=application/json, example={
|
||||
- examples: [{example={
|
||||
"key" : 123
|
||||
}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
|
||||
- examples: [{contentType=application/json, example={
|
||||
}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}]
|
||||
- examples: [{example={
|
||||
"key" : 123
|
||||
}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
|
||||
}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}]
|
||||
|
||||
- returns: RequestBuilder<[String:Int32]>
|
||||
*/
|
||||
@ -221,7 +209,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
@ -233,7 +220,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
|
||||
- returns: Promise<AnyObject>
|
||||
@ -251,21 +237,19 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
|
||||
- GET /store/inventory?response=arbitrary_object
|
||||
- GET /store/inventory?response=arbitrary_object
|
||||
- Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- examples: [{contentType=application/json, example="{}"}, {contentType=application/xml, example=not implemented io.swagger.models.properties.ObjectProperty@37aadb4f}]
|
||||
- examples: [{contentType=application/json, example="{}"}, {contentType=application/xml, example=not implemented io.swagger.models.properties.ObjectProperty@37aadb4f}]
|
||||
- examples: [{example="{}", contentType=application/json}, {example=not implemented io.swagger.models.properties.ObjectProperty@37aadb4f, contentType=application/xml}]
|
||||
- examples: [{example="{}", contentType=application/json}, {example=not implemented io.swagger.models.properties.ObjectProperty@37aadb4f, contentType=application/xml}]
|
||||
|
||||
- returns: RequestBuilder<AnyObject>
|
||||
*/
|
||||
public class func getInventoryInObjectWithRequestBuilder() -> RequestBuilder<AnyObject> {
|
||||
let path = "/store/inventory?response=arbitrary_object"
|
||||
let path = "/store/inventory?response=arbitrary_object"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let nillableParameters: [String:AnyObject?] = [:]
|
||||
@ -277,7 +261,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
- parameter orderId: (path) ID of pet that needs to be fetched
|
||||
@ -290,7 +273,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
- parameter orderId: (path) ID of pet that needs to be fetched
|
||||
@ -309,47 +291,45 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
- GET /store/order/{orderId}
|
||||
- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
- API Key:
|
||||
- type: apiKey test_api_key_query (QUERY)
|
||||
- name: test_api_key_query
|
||||
- API Key:
|
||||
- type: apiKey test_api_key_header
|
||||
- name: test_api_key_header
|
||||
- examples: [{contentType=application/json, example={
|
||||
"petId" : 123456789,
|
||||
"quantity" : 123,
|
||||
- API Key:
|
||||
- type: apiKey test_api_key_query (QUERY)
|
||||
- name: test_api_key_query
|
||||
- examples: [{example={
|
||||
"id" : 123456789,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000",
|
||||
"petId" : 123456789,
|
||||
"complete" : true,
|
||||
"status" : "aeiou"
|
||||
}}, {contentType=application/xml, example=<Order>
|
||||
"status" : "aeiou",
|
||||
"quantity" : 123,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000"
|
||||
}, contentType=application/json}, {example=<Order>
|
||||
<id>123456</id>
|
||||
<petId>123456</petId>
|
||||
<quantity>0</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>string</status>
|
||||
<complete>true</complete>
|
||||
</Order>}]
|
||||
- examples: [{contentType=application/json, example={
|
||||
"petId" : 123456789,
|
||||
"quantity" : 123,
|
||||
</Order>, contentType=application/xml}]
|
||||
- examples: [{example={
|
||||
"id" : 123456789,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000",
|
||||
"petId" : 123456789,
|
||||
"complete" : true,
|
||||
"status" : "aeiou"
|
||||
}}, {contentType=application/xml, example=<Order>
|
||||
"status" : "aeiou",
|
||||
"quantity" : 123,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000"
|
||||
}, contentType=application/json}, {example=<Order>
|
||||
<id>123456</id>
|
||||
<petId>123456</petId>
|
||||
<quantity>0</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>string</status>
|
||||
<complete>true</complete>
|
||||
</Order>}]
|
||||
</Order>, contentType=application/xml}]
|
||||
|
||||
- parameter orderId: (path) ID of pet that needs to be fetched
|
||||
|
||||
@ -369,7 +349,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
- parameter body: (body) order placed for purchasing the pet (optional)
|
||||
@ -382,7 +361,6 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
- parameter body: (body) order placed for purchasing the pet (optional)
|
||||
@ -401,9 +379,7 @@ public class StoreAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
- POST /store/order
|
||||
-
|
||||
- API Key:
|
||||
@ -412,36 +388,36 @@ public class StoreAPI: APIBase {
|
||||
- API Key:
|
||||
- type: apiKey x-test_api_client_secret
|
||||
- name: test_api_client_secret
|
||||
- examples: [{contentType=application/json, example={
|
||||
"petId" : 123456789,
|
||||
"quantity" : 123,
|
||||
- examples: [{example={
|
||||
"id" : 123456789,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000",
|
||||
"petId" : 123456789,
|
||||
"complete" : true,
|
||||
"status" : "aeiou"
|
||||
}}, {contentType=application/xml, example=<Order>
|
||||
"status" : "aeiou",
|
||||
"quantity" : 123,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000"
|
||||
}, contentType=application/json}, {example=<Order>
|
||||
<id>123456</id>
|
||||
<petId>123456</petId>
|
||||
<quantity>0</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>string</status>
|
||||
<complete>true</complete>
|
||||
</Order>}]
|
||||
- examples: [{contentType=application/json, example={
|
||||
"petId" : 123456789,
|
||||
"quantity" : 123,
|
||||
</Order>, contentType=application/xml}]
|
||||
- examples: [{example={
|
||||
"id" : 123456789,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000",
|
||||
"petId" : 123456789,
|
||||
"complete" : true,
|
||||
"status" : "aeiou"
|
||||
}}, {contentType=application/xml, example=<Order>
|
||||
"status" : "aeiou",
|
||||
"quantity" : 123,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000"
|
||||
}, contentType=application/json}, {example=<Order>
|
||||
<id>123456</id>
|
||||
<petId>123456</petId>
|
||||
<quantity>0</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>string</status>
|
||||
<complete>true</complete>
|
||||
</Order>}]
|
||||
</Order>, contentType=application/xml}]
|
||||
|
||||
- parameter body: (body) order placed for purchasing the pet (optional)
|
||||
|
||||
@ -450,7 +426,6 @@ public class StoreAPI: APIBase {
|
||||
public class func placeOrderWithRequestBuilder(body body: Order?) -> RequestBuilder<Order> {
|
||||
let path = "/store/order"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let parameters = body?.encodeToJSON() as? [String:AnyObject]
|
||||
|
||||
let requestBuilder: RequestBuilder<Order>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
@ -12,7 +12,6 @@ import PromiseKit
|
||||
|
||||
public class UserAPI: APIBase {
|
||||
/**
|
||||
|
||||
Create user
|
||||
|
||||
- parameter body: (body) Created user object (optional)
|
||||
@ -25,7 +24,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Create user
|
||||
|
||||
- parameter body: (body) Created user object (optional)
|
||||
@ -44,9 +42,7 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Create user
|
||||
|
||||
- POST /user
|
||||
- This can only be done by the logged in user.
|
||||
|
||||
@ -57,7 +53,6 @@ public class UserAPI: APIBase {
|
||||
public class func createUserWithRequestBuilder(body body: User?) -> RequestBuilder<Void> {
|
||||
let path = "/user"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let parameters = body?.encodeToJSON() as? [String:AnyObject]
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
@ -66,7 +61,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
- parameter body: (body) List of user object (optional)
|
||||
@ -79,7 +73,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
- parameter body: (body) List of user object (optional)
|
||||
@ -98,9 +91,7 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
- POST /user/createWithArray
|
||||
-
|
||||
|
||||
@ -111,7 +102,6 @@ public class UserAPI: APIBase {
|
||||
public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]?) -> RequestBuilder<Void> {
|
||||
let path = "/user/createWithArray"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let parameters = body?.encodeToJSON() as? [String:AnyObject]
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
@ -120,7 +110,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
- parameter body: (body) List of user object (optional)
|
||||
@ -133,7 +122,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
- parameter body: (body) List of user object (optional)
|
||||
@ -152,9 +140,7 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
- POST /user/createWithList
|
||||
-
|
||||
|
||||
@ -165,7 +151,6 @@ public class UserAPI: APIBase {
|
||||
public class func createUsersWithListInputWithRequestBuilder(body body: [User]?) -> RequestBuilder<Void> {
|
||||
let path = "/user/createWithList"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let parameters = body?.encodeToJSON() as? [String:AnyObject]
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
@ -174,7 +159,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Delete user
|
||||
|
||||
- parameter username: (path) The name that needs to be deleted
|
||||
@ -187,7 +171,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Delete user
|
||||
|
||||
- parameter username: (path) The name that needs to be deleted
|
||||
@ -206,9 +189,7 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Delete user
|
||||
|
||||
- DELETE /user/{username}
|
||||
- This can only be done by the logged in user.
|
||||
- BASIC:
|
||||
@ -233,7 +214,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Get user by user name
|
||||
|
||||
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
|
||||
@ -246,7 +226,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Get user by user name
|
||||
|
||||
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
|
||||
@ -265,12 +244,10 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Get user by user name
|
||||
|
||||
- GET /user/{username}
|
||||
-
|
||||
- examples: [{contentType=application/json, example={
|
||||
- examples: [{example={
|
||||
"id" : 1,
|
||||
"username" : "johnp",
|
||||
"firstName" : "John",
|
||||
@ -279,7 +256,7 @@ public class UserAPI: APIBase {
|
||||
"password" : "-secret-",
|
||||
"phone" : "0123456789",
|
||||
"userStatus" : 0
|
||||
}}]
|
||||
}, contentType=application/json}]
|
||||
|
||||
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
@ -299,7 +276,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Logs user into the system
|
||||
|
||||
- parameter username: (query) The user name for login (optional)
|
||||
@ -313,7 +289,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Logs user into the system
|
||||
|
||||
- parameter username: (query) The user name for login (optional)
|
||||
@ -333,13 +308,11 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Logs user into the system
|
||||
|
||||
- GET /user/login
|
||||
-
|
||||
- examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
|
||||
- examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
|
||||
- examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}]
|
||||
- examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}]
|
||||
|
||||
- parameter username: (query) The user name for login (optional)
|
||||
- parameter password: (query) The password for login in clear text (optional)
|
||||
@ -362,7 +335,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
@ -374,7 +346,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
- returns: Promise<Void>
|
||||
@ -392,9 +363,7 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
- GET /user/logout
|
||||
-
|
||||
|
||||
@ -413,7 +382,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Updated user
|
||||
|
||||
- parameter username: (path) name that need to be deleted
|
||||
@ -427,7 +395,6 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Updated user
|
||||
|
||||
- parameter username: (path) name that need to be deleted
|
||||
@ -447,9 +414,7 @@ public class UserAPI: APIBase {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Updated user
|
||||
|
||||
- PUT /user/{username}
|
||||
- This can only be done by the logged in user.
|
||||
|
||||
@ -462,7 +427,6 @@ public class UserAPI: APIBase {
|
||||
var path = "/user/{username}"
|
||||
path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
|
||||
let parameters = body?.encodeToJSON() as? [String:AnyObject]
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
@ -130,6 +130,33 @@ class Decoders {
|
||||
fatalError("formatter failed to parse \(source)")
|
||||
}
|
||||
|
||||
// Decoder for [Animal]
|
||||
Decoders.addDecoder(clazz: [Animal].self) { (source: AnyObject) -> [Animal] in
|
||||
return Decoders.decode(clazz: [Animal].self, source: source)
|
||||
}
|
||||
// Decoder for Animal
|
||||
Decoders.addDecoder(clazz: Animal.self) { (source: AnyObject) -> Animal in
|
||||
let sourceDictionary = source as! [NSObject:AnyObject]
|
||||
let instance = Animal()
|
||||
instance.className = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"])
|
||||
return instance
|
||||
}
|
||||
|
||||
|
||||
// Decoder for [Cat]
|
||||
Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject) -> [Cat] in
|
||||
return Decoders.decode(clazz: [Cat].self, source: source)
|
||||
}
|
||||
// Decoder for Cat
|
||||
Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject) -> Cat in
|
||||
let sourceDictionary = source as! [NSObject:AnyObject]
|
||||
let instance = Cat()
|
||||
instance.className = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"])
|
||||
instance.declawed = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"])
|
||||
return instance
|
||||
}
|
||||
|
||||
|
||||
// Decoder for [Category]
|
||||
Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in
|
||||
return Decoders.decode(clazz: [Category].self, source: source)
|
||||
@ -144,6 +171,43 @@ class Decoders {
|
||||
}
|
||||
|
||||
|
||||
// Decoder for [Dog]
|
||||
Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject) -> [Dog] in
|
||||
return Decoders.decode(clazz: [Dog].self, source: source)
|
||||
}
|
||||
// Decoder for Dog
|
||||
Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject) -> Dog in
|
||||
let sourceDictionary = source as! [NSObject:AnyObject]
|
||||
let instance = Dog()
|
||||
instance.className = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"])
|
||||
instance.breed = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"])
|
||||
return instance
|
||||
}
|
||||
|
||||
|
||||
// Decoder for [FormatTest]
|
||||
Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject) -> [FormatTest] in
|
||||
return Decoders.decode(clazz: [FormatTest].self, source: source)
|
||||
}
|
||||
// Decoder for FormatTest
|
||||
Decoders.addDecoder(clazz: FormatTest.self) { (source: AnyObject) -> FormatTest in
|
||||
let sourceDictionary = source as! [NSObject:AnyObject]
|
||||
let instance = FormatTest()
|
||||
instance.integer = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer"])
|
||||
instance._int32 = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["int32"])
|
||||
instance._int64 = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["int64"])
|
||||
instance.number = Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number"])
|
||||
instance._float = Decoders.decodeOptional(clazz: Float.self, source: sourceDictionary["float"])
|
||||
instance._double = Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["double"])
|
||||
instance._string = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string"])
|
||||
instance.byte = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["byte"])
|
||||
instance.binary = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["binary"])
|
||||
instance.date = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["date"])
|
||||
instance.dateTime = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["dateTime"])
|
||||
return instance
|
||||
}
|
||||
|
||||
|
||||
// Decoder for [InlineResponse200]
|
||||
Decoders.addDecoder(clazz: [InlineResponse200].self) { (source: AnyObject) -> [InlineResponse200] in
|
||||
return Decoders.decode(clazz: [InlineResponse200].self, source: source)
|
||||
@ -152,12 +216,12 @@ class Decoders {
|
||||
Decoders.addDecoder(clazz: InlineResponse200.self) { (source: AnyObject) -> InlineResponse200 in
|
||||
let sourceDictionary = source as! [NSObject:AnyObject]
|
||||
let instance = InlineResponse200()
|
||||
instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"])
|
||||
instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"])
|
||||
instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"])
|
||||
instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"])
|
||||
instance.category = Decoders.decodeOptional(clazz: AnyObject.self, source: sourceDictionary["category"])
|
||||
instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"])
|
||||
instance.status = InlineResponse200.Status(rawValue: (sourceDictionary["status"] as? String) ?? "")
|
||||
instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"])
|
||||
instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"])
|
||||
return instance
|
||||
}
|
||||
|
||||
@ -283,7 +347,6 @@ class Decoders {
|
||||
instance.userStatus = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["userStatus"])
|
||||
return instance
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,17 +9,16 @@ import Foundation
|
||||
|
||||
|
||||
public class Category: JSONEncodable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
func encodeToJSON() -> AnyObject {
|
||||
var nillableDictionary = [String:AnyObject?]()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["name"] = self.name
|
||||
let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:]
|
||||
return dictionary
|
||||
|
@ -9,33 +9,31 @@ import Foundation
|
||||
|
||||
|
||||
public class InlineResponse200: JSONEncodable {
|
||||
|
||||
public enum Status: String {
|
||||
case Available = "available"
|
||||
case Pending = "pending"
|
||||
case Sold = "sold"
|
||||
}
|
||||
|
||||
public var photoUrls: [String]?
|
||||
public var name: String?
|
||||
public var tags: [Tag]?
|
||||
public var id: Int64?
|
||||
public var category: AnyObject?
|
||||
public var tags: [Tag]?
|
||||
/** pet status in the store */
|
||||
public var status: Status?
|
||||
|
||||
public var name: String?
|
||||
public var photoUrls: [String]?
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
func encodeToJSON() -> AnyObject {
|
||||
var nillableDictionary = [String:AnyObject?]()
|
||||
nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON()
|
||||
nillableDictionary["name"] = self.name
|
||||
nillableDictionary["tags"] = self.tags?.encodeToJSON()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["category"] = self.category
|
||||
nillableDictionary["tags"] = self.tags?.encodeToJSON()
|
||||
nillableDictionary["status"] = self.status?.rawValue
|
||||
nillableDictionary["name"] = self.name
|
||||
nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON()
|
||||
let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:]
|
||||
return dictionary
|
||||
}
|
||||
|
@ -8,11 +8,10 @@
|
||||
import Foundation
|
||||
|
||||
|
||||
/** Model for testing model name starting with number */
|
||||
public class Model200Response: JSONEncodable {
|
||||
|
||||
public var name: Int32?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
|
@ -8,11 +8,10 @@
|
||||
import Foundation
|
||||
|
||||
|
||||
/** Model for testing reserved words */
|
||||
public class ModelReturn: JSONEncodable {
|
||||
|
||||
public var _return: Int32?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
|
@ -8,12 +8,11 @@
|
||||
import Foundation
|
||||
|
||||
|
||||
/** Model for testing model name same as property name */
|
||||
public class Name: JSONEncodable {
|
||||
|
||||
public var name: Int32?
|
||||
public var snakeCase: Int32?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
|
@ -9,13 +9,11 @@ import Foundation
|
||||
|
||||
|
||||
public class Order: JSONEncodable {
|
||||
|
||||
public enum Status: String {
|
||||
case Placed = "placed"
|
||||
case Approved = "approved"
|
||||
case Delivered = "delivered"
|
||||
}
|
||||
|
||||
public var id: Int64?
|
||||
public var petId: Int64?
|
||||
public var quantity: Int32?
|
||||
@ -24,13 +22,14 @@ public class Order: JSONEncodable {
|
||||
public var status: Status?
|
||||
public var complete: Bool?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
func encodeToJSON() -> AnyObject {
|
||||
var nillableDictionary = [String:AnyObject?]()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["petId"] = self.petId?.encodeToJSON()
|
||||
nillableDictionary["petId"] = self.petId?.encodeToJSON()
|
||||
nillableDictionary["quantity"] = self.quantity?.encodeToJSON()
|
||||
nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON()
|
||||
|
@ -9,13 +9,11 @@ import Foundation
|
||||
|
||||
|
||||
public class Pet: JSONEncodable {
|
||||
|
||||
public enum Status: String {
|
||||
case Available = "available"
|
||||
case Pending = "pending"
|
||||
case Sold = "sold"
|
||||
}
|
||||
|
||||
public var id: Int64?
|
||||
public var category: Category?
|
||||
public var name: String?
|
||||
@ -24,13 +22,13 @@ public class Pet: JSONEncodable {
|
||||
/** pet status in the store */
|
||||
public var status: Status?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
func encodeToJSON() -> AnyObject {
|
||||
var nillableDictionary = [String:AnyObject?]()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["category"] = self.category?.encodeToJSON()
|
||||
nillableDictionary["name"] = self.name
|
||||
nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON()
|
||||
|
@ -9,16 +9,15 @@ import Foundation
|
||||
|
||||
|
||||
public class SpecialModelName: JSONEncodable {
|
||||
|
||||
public var specialPropertyName: Int64?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
func encodeToJSON() -> AnyObject {
|
||||
var nillableDictionary = [String:AnyObject?]()
|
||||
nillableDictionary["$special[property.name]"] = self.specialPropertyName?.encodeToJSON()
|
||||
nillableDictionary["$special[property.name]"] = self.specialPropertyName?.encodeToJSON()
|
||||
let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:]
|
||||
return dictionary
|
||||
}
|
||||
|
@ -9,17 +9,16 @@ import Foundation
|
||||
|
||||
|
||||
public class Tag: JSONEncodable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
func encodeToJSON() -> AnyObject {
|
||||
var nillableDictionary = [String:AnyObject?]()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["name"] = self.name
|
||||
let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:]
|
||||
return dictionary
|
||||
|
@ -9,7 +9,6 @@ import Foundation
|
||||
|
||||
|
||||
public class User: JSONEncodable {
|
||||
|
||||
public var id: Int64?
|
||||
public var username: String?
|
||||
public var firstName: String?
|
||||
@ -20,13 +19,13 @@ public class User: JSONEncodable {
|
||||
/** User Status */
|
||||
public var userStatus: Int32?
|
||||
|
||||
|
||||
public init() {}
|
||||
|
||||
// MARK: JSONEncodable
|
||||
func encodeToJSON() -> AnyObject {
|
||||
var nillableDictionary = [String:AnyObject?]()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["id"] = self.id?.encodeToJSON()
|
||||
nillableDictionary["username"] = self.username
|
||||
nillableDictionary["firstName"] = self.firstName
|
||||
nillableDictionary["lastName"] = self.lastName
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -190,13 +190,19 @@ class VoidAuth implements Authentication {
|
||||
}
|
||||
}
|
||||
|
||||
export enum PetApiApiKeys {
|
||||
test_api_key_header,
|
||||
api_key,
|
||||
test_api_client_secret,
|
||||
test_api_client_id,
|
||||
test_api_key_query,
|
||||
}
|
||||
|
||||
export class PetApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
protected defaultHeaders : any = {};
|
||||
|
||||
|
||||
|
||||
public authentications = {
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'test_api_key_header': new ApiKeyAuth('header', 'test_api_key_header'),
|
||||
'api_key': new ApiKeyAuth('header', 'api_key'),
|
||||
@ -223,12 +229,8 @@ export class PetApi {
|
||||
}
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_key_header.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.api_key.apiKey = key;
|
||||
public setApiKey(key: PetApiApiKeys, value: string) {
|
||||
this.authentications[PetApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
@ -239,18 +241,6 @@ export class PetApi {
|
||||
this.authentications.test_http_basic.password = password;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_client_secret.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_client_id.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_key_query.apiKey = key;
|
||||
}
|
||||
|
||||
set accessToken(token: string) {
|
||||
this.authentications.petstore_auth.accessToken = token;
|
||||
}
|
||||
@ -890,13 +880,19 @@ export class PetApi {
|
||||
return localVarDeferred.promise;
|
||||
}
|
||||
}
|
||||
export enum StoreApiApiKeys {
|
||||
test_api_key_header,
|
||||
api_key,
|
||||
test_api_client_secret,
|
||||
test_api_client_id,
|
||||
test_api_key_query,
|
||||
}
|
||||
|
||||
export class StoreApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
protected defaultHeaders : any = {};
|
||||
|
||||
|
||||
|
||||
public authentications = {
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'test_api_key_header': new ApiKeyAuth('header', 'test_api_key_header'),
|
||||
'api_key': new ApiKeyAuth('header', 'api_key'),
|
||||
@ -923,12 +919,8 @@ export class StoreApi {
|
||||
}
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_key_header.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.api_key.apiKey = key;
|
||||
public setApiKey(key: StoreApiApiKeys, value: string) {
|
||||
this.authentications[StoreApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
@ -939,18 +931,6 @@ export class StoreApi {
|
||||
this.authentications.test_http_basic.password = password;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_client_secret.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_client_id.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_key_query.apiKey = key;
|
||||
}
|
||||
|
||||
set accessToken(token: string) {
|
||||
this.authentications.petstore_auth.accessToken = token;
|
||||
}
|
||||
@ -1282,13 +1262,19 @@ export class StoreApi {
|
||||
return localVarDeferred.promise;
|
||||
}
|
||||
}
|
||||
export enum UserApiApiKeys {
|
||||
test_api_key_header,
|
||||
api_key,
|
||||
test_api_client_secret,
|
||||
test_api_client_id,
|
||||
test_api_key_query,
|
||||
}
|
||||
|
||||
export class UserApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
protected defaultHeaders : any = {};
|
||||
|
||||
|
||||
|
||||
public authentications = {
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'test_api_key_header': new ApiKeyAuth('header', 'test_api_key_header'),
|
||||
'api_key': new ApiKeyAuth('header', 'api_key'),
|
||||
@ -1315,12 +1301,8 @@ export class UserApi {
|
||||
}
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_key_header.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.api_key.apiKey = key;
|
||||
public setApiKey(key: UserApiApiKeys, value: string) {
|
||||
this.authentications[UserApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
@ -1331,18 +1313,6 @@ export class UserApi {
|
||||
this.authentications.test_http_basic.password = password;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_client_secret.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_client_id.apiKey = key;
|
||||
}
|
||||
|
||||
set apiKey(key: string) {
|
||||
this.authentications.test_api_key_query.apiKey = key;
|
||||
}
|
||||
|
||||
set accessToken(token: string) {
|
||||
this.authentications.petstore_auth.accessToken = token;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user