This commit is contained in:
David Hontecillas 2016-02-16 14:06:30 +01:00
commit 81ca40f661
31 changed files with 672 additions and 804 deletions

View File

@ -32,8 +32,10 @@ import org.apache.maven.project.MavenProject;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static io.swagger.codegen.plugin.AdditionalParams.*;
@ -155,40 +157,36 @@ public class CodeGenMojo extends AbstractMojo {
if (null != invokerPackage) {
config.additionalProperties().put(INVOKER_PACKAGE_PARAM, invokerPackage);
}
Set<String> definedOptions = new HashSet<String>();
for (CliOption langCliOption : config.cliOptions()) {
definedOptions.add(langCliOption.getOpt());
}
if (configOptions != null) {
for (CliOption langCliOption : config.cliOptions()) {
if (configOptions.containsKey(langCliOption.getOpt())) {
config.additionalProperties().put(langCliOption.getOpt(),
configOptions.get(langCliOption.getOpt()));
}
}
if(configOptions.containsKey("import-mappings")) {
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.get("import-mappings").toString());
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.remove("import-mappings").toString());
config.importMapping().putAll(mappings);
}
if(configOptions.containsKey("type-mappings")) {
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.get("type-mappings").toString());
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.remove("type-mappings").toString());
config.typeMapping().putAll(mappings);
}
if(configOptions.containsKey("instantiation-types")) {
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.get("instantiation-types").toString());
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.remove("instantiation-types").toString());
config.instantiationTypes().putAll(mappings);
}
addAdditionalProperties(config, definedOptions, configOptions);
}
if (null != configurationFile) {
Config genConfig = ConfigParser.read(configurationFile);
if (null != genConfig) {
for (CliOption langCliOption : config.cliOptions()) {
if (genConfig.hasOption(langCliOption.getOpt())) {
config.additionalProperties().put(langCliOption.getOpt(), genConfig.getOption(langCliOption.getOpt()));
}
}
addAdditionalProperties(config, definedOptions, genConfig.getOptions());
} else {
throw new RuntimeException("Unable to read configuration file");
throw new RuntimeException("Unable to read configuration file");
}
}
@ -207,8 +205,8 @@ public class CodeGenMojo extends AbstractMojo {
new DefaultGenerator().opts(input).generate();
} catch (Exception e) {
// Maven logs exceptions thrown by plugins only if invoked with -e
// I find it annoying to jump through hoops to get basic diagnostic information,
// so let's log it in any case:
// I find it annoying to jump through hoops to get basic diagnostic information,
// so let's log it in any case:
getLog().error(e);
throw new MojoExecutionException("Code generation failed. See above for the full exception.");
}
@ -217,6 +215,15 @@ public class CodeGenMojo extends AbstractMojo {
project.addCompileSourceRoot(output.toString());
}
}
private void addAdditionalProperties(CodegenConfig config, Set<String> definedOptions, Map<?,?> configOptions) {
for(Map.Entry<?, ?> configEntry : configOptions.entrySet()) {
config.additionalProperties().put(configEntry.getKey().toString(), configEntry.getValue());
if(!definedOptions.contains(configEntry.getKey())) {
getLog().warn("Additional property: " + configEntry.getKey() + " is not defined for this language.");
}
}
}
private static Map<String, String> createMapFromKeyValuePairs(String commaSeparatedKVPairs) {
final List<Pair<String, String>> pairs = OptionUtils.parseCommaSeparatedTuples(commaSeparatedKVPairs);

View File

@ -3,6 +3,7 @@ package io.swagger.codegen.languages;
import io.swagger.codegen.CliOption;
import io.swagger.codegen.CodegenConfig;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.CodegenType;
import io.swagger.codegen.DefaultCodegen;
@ -13,6 +14,8 @@ import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
@ -456,6 +459,21 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
this.license = license;
}
@Override
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
if (operations != null) {
List<CodegenOperation> ops = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation operation : ops) {
if (!operation.allParams.isEmpty()) {
String firstParamName = operation.allParams.get(0).paramName;
operation.vendorExtensions.put("firstParamAltName", camelize(firstParamName));
}
}
}
return objs;
}
/**
* Return the default value of the property
*

View File

@ -20,7 +20,7 @@ mvn deploy
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
After the client libarary is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*:
After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*:
```xml
<dependency>

View File

@ -1,17 +1,10 @@
//export module
if ( typeof define === "function" && define.amd ) {
define('{{datatypeWithEnum}}', [], function() {
return {{datatypeWithEnum}};
});
}
var {{datatypeWithEnum}} = {
{{#allowableValues}}{{#enumVars}}
/**
* @const
*/
{{name}}: "{{value}}"{{^-last}},
{{/-last}}{{/enumVars}}{{/allowableValues}}
/**
* @const
*/
{{name}}: "{{value}}"{{^-last}},
{{/-last}}{{/enumVars}}{{/allowableValues}}
};
}
{{classname}}.{{datatypeWithEnum}} = {{datatypeWithEnum}};

View File

@ -14,11 +14,7 @@
}
}(this, function(module, ApiClient{{#imports}}, {{import}}{{/imports}}) {
'use strict';
{{#models}}{{#model}}
{{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}
{{>enumClass}}{{/items}}*/{{/items.isEnum}}{{/vars}}
{{#description}}/**
* {{description}}
**/{{/description}}
@ -74,6 +70,9 @@
return JSON.stringify(this);
}
{{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}
{{>enumClass}}{{/items}}*/{{/items.isEnum}}{{/vars}}
if (module) {
module.{{classname}} = {{classname}};
}

View File

@ -499,19 +499,19 @@ static void (^reachabilityChangeBlock)(int);
#pragma mark - Perform Request Methods
-(NSNumber*) requestWithCompletionBlock: (NSString*) path
method: (NSString*) method
pathParams: (NSDictionary *) pathParams
queryParams: (NSDictionary*) queryParams
formParams: (NSDictionary *) formParams
files: (NSDictionary *) files
body: (id) body
headerParams: (NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType: (NSString*) requestContentType
responseContentType: (NSString*) responseContentType
responseType: (NSString *) responseType
completionBlock: (void (^)(id, NSError *))completionBlock {
-(NSNumber*) requestWithPath: (NSString*) path
method: (NSString*) method
pathParams: (NSDictionary *) pathParams
queryParams: (NSDictionary*) queryParams
formParams: (NSDictionary *) formParams
files: (NSDictionary *) files
body: (id) body
headerParams: (NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType: (NSString*) requestContentType
responseContentType: (NSString*) responseContentType
responseType: (NSString *) responseType
completionBlock: (void (^)(id, NSError *))completionBlock {
// setting request serializer
if ([requestContentType isEqualToString:@"application/json"]) {
self.requestSerializer = [{{classPrefix}}JSONRequestSerializer serializer];

View File

@ -186,19 +186,19 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey;
*
* @return The request id.
*/
-(NSNumber*) requestWithCompletionBlock:(NSString*) path
method:(NSString*) method
pathParams:(NSDictionary *) pathParams
queryParams:(NSDictionary*) queryParams
formParams:(NSDictionary *) formParams
files:(NSDictionary *) files
body:(id) body
headerParams:(NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType:(NSString*) requestContentType
responseContentType:(NSString*) responseContentType
responseType:(NSString *) responseType
completionBlock:(void (^)(id, NSError *))completionBlock;
-(NSNumber*) requestWithPath:(NSString*) path
method:(NSString*) method
pathParams:(NSDictionary *) pathParams
queryParams:(NSDictionary*) queryParams
formParams:(NSDictionary *) formParams
files:(NSDictionary *) files
body:(id) body
headerParams:(NSDictionary*) headerParams
authSettings:(NSArray *) authSettings
requestContentType:(NSString*) requestContentType
responseContentType:(NSString*) responseContentType
responseType:(NSString *) responseType
completionBlock:(void (^)(id, NSError *))completionBlock;
/**
* Sanitize object for request

View File

@ -79,10 +79,9 @@ static {{classname}}* singletonAPI = nil;
///
/// {{/allParams}} @returns {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
///
-(NSNumber*) {{nickname}}WithCompletionBlock{{^allParams}}: {{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}
{{/allParams}}
{{#returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock { {{/returnBaseType}}
{{^returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock { {{/returnBaseType}}
-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}}
{{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}}
{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler {
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
@ -164,22 +163,21 @@ static {{classname}}* singletonAPI = nil;
}
{{/requiredParams}}
{{/requiredParamCount}}
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"{{httpMethod}}"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: {{^returnType}}nil{{/returnType}}{{#returnType}}@"{{{ returnType }}}"{{/returnType}}
completionBlock: ^(id data, NSError *error) {
{{^returnType}}completionBlock(error);{{/returnType}}
{{#returnType}}completionBlock(({{{ returnType }}})data, error);{{/returnType}}
}
return [self.apiClient requestWithPath: resourcePath
method: @"{{httpMethod}}"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: {{^returnType}}nil{{/returnType}}{{#returnType}}@"{{{ returnType }}}"{{/returnType}}
completionBlock: ^(id data, NSError *error) {
handler({{#returnType}}({{{ returnType }}})data, {{/returnType}}error);
}
];
}

View File

@ -31,12 +31,9 @@
/// {{/allParams}}
///
/// @return {{{returnType}}}
-(NSNumber*) {{nickname}}WithCompletionBlock {{^allParams}}:{{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}:({{{dataType}}}) {{paramName}} {{#hasMore}}
{{/hasMore}}{{/allParams}}
{{#returnBaseType}}{{#hasParams}}
completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock;{{/returnBaseType}}
{{^returnBaseType}}{{#hasParams}}
completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock;{{/returnBaseType}}
-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}}
{{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}}
{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler;
{{newline}}
{{/operation}}

View File

@ -14,11 +14,8 @@
}
}(this, function(module, ApiClient) {
'use strict';
var Category = function Category() {
/**
@ -86,6 +83,8 @@
return JSON.stringify(this);
}
if (module) {
module.Category = Category;
}

View File

@ -14,37 +14,8 @@
}
}(this, function(module, ApiClient) {
'use strict';
//export module
if ( typeof define === "function" && define.amd ) {
define('StatusEnum', [], function() {
return StatusEnum;
});
}
var StatusEnum = {
/**
* @const
*/
PLACED: "placed",
/**
* @const
*/
APPROVED: "approved",
/**
* @const
*/
DELIVERED: "delivered"
}
var Order = function Order() {
/**
@ -207,6 +178,27 @@ var StatusEnum = {
return JSON.stringify(this);
}
var StatusEnum = {
/**
* @const
*/
PLACED: "placed",
/**
* @const
*/
APPROVED: "approved",
/**
* @const
*/
DELIVERED: "delivered"
};
Order.StatusEnum = StatusEnum;
if (module) {
module.Order = Order;
}

View File

@ -14,37 +14,8 @@
}
}(this, function(module, ApiClient, Category, Tag) {
'use strict';
//export module
if ( typeof define === "function" && define.amd ) {
define('StatusEnum', [], function() {
return StatusEnum;
});
}
var StatusEnum = {
/**
* @const
*/
AVAILABLE: "available",
/**
* @const
*/
PENDING: "pending",
/**
* @const
*/
SOLD: "sold"
}
var Pet = function Pet(photoUrls, name) {
/**
@ -209,6 +180,27 @@ var StatusEnum = {
return JSON.stringify(this);
}
var StatusEnum = {
/**
* @const
*/
AVAILABLE: "available",
/**
* @const
*/
PENDING: "pending",
/**
* @const
*/
SOLD: "sold"
};
Pet.StatusEnum = StatusEnum;
if (module) {
module.Pet = Pet;
}

View File

@ -14,11 +14,8 @@
}
}(this, function(module, ApiClient) {
'use strict';
var Tag = function Tag() {
/**
@ -86,6 +83,8 @@
return JSON.stringify(this);
}
if (module) {
module.Tag = Tag;
}

View File

@ -14,11 +14,8 @@
}
}(this, function(module, ApiClient) {
'use strict';
var User = function User() {
/**
@ -227,6 +224,8 @@
return JSON.stringify(this);
}
if (module) {
module.User = User;
}

View File

@ -14,11 +14,8 @@
}
}(this, function(module, ApiClient) {
'use strict';
var Category = function Category() {
/**
@ -86,6 +83,8 @@
return JSON.stringify(this);
}
if (module) {
module.Category = Category;
}

View File

@ -14,37 +14,8 @@
}
}(this, function(module, ApiClient) {
'use strict';
//export module
if ( typeof define === "function" && define.amd ) {
define('StatusEnum', [], function() {
return StatusEnum;
});
}
var StatusEnum = {
/**
* @const
*/
PLACED: "placed",
/**
* @const
*/
APPROVED: "approved",
/**
* @const
*/
DELIVERED: "delivered"
}
var Order = function Order() {
/**
@ -207,6 +178,27 @@ var StatusEnum = {
return JSON.stringify(this);
}
var StatusEnum = {
/**
* @const
*/
PLACED: "placed",
/**
* @const
*/
APPROVED: "approved",
/**
* @const
*/
DELIVERED: "delivered"
};
Order.StatusEnum = StatusEnum;
if (module) {
module.Order = Order;
}

View File

@ -14,37 +14,8 @@
}
}(this, function(module, ApiClient, Category, Tag) {
'use strict';
//export module
if ( typeof define === "function" && define.amd ) {
define('StatusEnum', [], function() {
return StatusEnum;
});
}
var StatusEnum = {
/**
* @const
*/
AVAILABLE: "available",
/**
* @const
*/
PENDING: "pending",
/**
* @const
*/
SOLD: "sold"
}
var Pet = function Pet(photoUrls, name) {
/**
@ -209,6 +180,27 @@ var StatusEnum = {
return JSON.stringify(this);
}
var StatusEnum = {
/**
* @const
*/
AVAILABLE: "available",
/**
* @const
*/
PENDING: "pending",
/**
* @const
*/
SOLD: "sold"
};
Pet.StatusEnum = StatusEnum;
if (module) {
module.Pet = Pet;
}

View File

@ -14,11 +14,8 @@
}
}(this, function(module, ApiClient) {
'use strict';
var Tag = function Tag() {
/**
@ -86,6 +83,8 @@
return JSON.stringify(this);
}
if (module) {
module.Tag = Tag;
}

View File

@ -14,11 +14,8 @@
}
}(this, function(module, ApiClient) {
'use strict';
var User = function User() {
/**
@ -227,6 +224,8 @@
return JSON.stringify(this);
}
if (module) {
module.User = User;
}

View File

@ -190,19 +190,19 @@ extern NSString *const SWGResponseObjectErrorKey;
*
* @return The request id.
*/
-(NSNumber*) requestWithCompletionBlock:(NSString*) path
method:(NSString*) method
pathParams:(NSDictionary *) pathParams
queryParams:(NSDictionary*) queryParams
formParams:(NSDictionary *) formParams
files:(NSDictionary *) files
body:(id) body
headerParams:(NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType:(NSString*) requestContentType
responseContentType:(NSString*) responseContentType
responseType:(NSString *) responseType
completionBlock:(void (^)(id, NSError *))completionBlock;
-(NSNumber*) requestWithPath:(NSString*) path
method:(NSString*) method
pathParams:(NSDictionary *) pathParams
queryParams:(NSDictionary*) queryParams
formParams:(NSDictionary *) formParams
files:(NSDictionary *) files
body:(id) body
headerParams:(NSDictionary*) headerParams
authSettings:(NSArray *) authSettings
requestContentType:(NSString*) requestContentType
responseContentType:(NSString*) responseContentType
responseType:(NSString *) responseType
completionBlock:(void (^)(id, NSError *))completionBlock;
/**
* Sanitize object for request

View File

@ -499,19 +499,19 @@ static void (^reachabilityChangeBlock)(int);
#pragma mark - Perform Request Methods
-(NSNumber*) requestWithCompletionBlock: (NSString*) path
method: (NSString*) method
pathParams: (NSDictionary *) pathParams
queryParams: (NSDictionary*) queryParams
formParams: (NSDictionary *) formParams
files: (NSDictionary *) files
body: (id) body
headerParams: (NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType: (NSString*) requestContentType
responseContentType: (NSString*) responseContentType
responseType: (NSString *) responseType
completionBlock: (void (^)(id, NSError *))completionBlock {
-(NSNumber*) requestWithPath: (NSString*) path
method: (NSString*) method
pathParams: (NSDictionary *) pathParams
queryParams: (NSDictionary*) queryParams
formParams: (NSDictionary *) formParams
files: (NSDictionary *) files
body: (id) body
headerParams: (NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType: (NSString*) requestContentType
responseContentType: (NSString*) responseContentType
responseType: (NSString *) responseType
completionBlock: (void (^)(id, NSError *))completionBlock {
// setting request serializer
if ([requestContentType isEqualToString:@"application/json"]) {
self.requestSerializer = [SWGJSONRequestSerializer serializer];

View File

@ -28,10 +28,8 @@
///
///
/// @return
-(NSNumber*) updatePetWithCompletionBlock :(SWGPet*) body
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) updatePetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler;
///
@ -43,10 +41,8 @@
///
///
/// @return
-(NSNumber*) addPetWithCompletionBlock :(SWGPet*) body
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) addPetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler;
///
@ -58,10 +54,8 @@
///
///
/// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByStatusWithCompletionBlock :(NSArray* /* NSString */) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock;
-(NSNumber*) findPetsByStatusWithStatus: (NSArray* /* NSString */) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler;
///
@ -73,10 +67,8 @@
///
///
/// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByTagsWithCompletionBlock :(NSArray* /* NSString */) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock;
-(NSNumber*) findPetsByTagsWithTags: (NSArray* /* NSString */) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler;
///
@ -88,10 +80,8 @@
///
///
/// @return SWGPet*
-(NSNumber*) getPetByIdWithCompletionBlock :(NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock;
-(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error)) handler;
///
@ -105,12 +95,10 @@
///
///
/// @return
-(NSNumber*) updatePetWithFormWithCompletionBlock :(NSString*) petId
name:(NSString*) name
status:(NSString*) status
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
name: (NSString*) name
status: (NSString*) status
completionHandler: (void (^)(NSError* error)) handler;
///
@ -123,11 +111,9 @@
///
///
/// @return
-(NSNumber*) deletePetWithCompletionBlock :(NSNumber*) petId
apiKey:(NSString*) apiKey
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId
apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error)) handler;
///
@ -141,12 +127,10 @@
///
///
/// @return
-(NSNumber*) uploadFileWithCompletionBlock :(NSNumber*) petId
additionalMetadata:(NSString*) additionalMetadata
file:(NSURL*) file
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata
file: (NSURL*) file
completionHandler: (void (^)(NSError* error)) handler;
///
@ -158,10 +142,8 @@
///
///
/// @return NSString*
-(NSNumber*) getPetByIdWithByteArrayWithCompletionBlock :(NSNumber*) petId
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock;
-(NSNumber*) getPetByIdWithByteArrayWithPetId: (NSNumber*) petId
completionHandler: (void (^)(NSString* output, NSError* error)) handler;
///
@ -173,10 +155,8 @@
///
///
/// @return
-(NSNumber*) addPetUsingByteArrayWithCompletionBlock :(NSString*) body
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) addPetUsingByteArrayWithBody: (NSString*) body
completionHandler: (void (^)(NSError* error)) handler;

View File

@ -76,10 +76,8 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) updatePetWithCompletionBlock: (SWGPet*) body
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) updatePetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler {
@ -128,22 +126,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"PUT"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"PUT"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -154,10 +151,8 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) addPetWithCompletionBlock: (SWGPet*) body
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) addPetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler {
@ -206,22 +201,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -232,10 +226,8 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns NSArray<SWGPet>*
///
-(NSNumber*) findPetsByStatusWithCompletionBlock: (NSArray* /* NSString */) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock {
-(NSNumber*) findPetsByStatusWithStatus: (NSArray* /* NSString */) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler {
@ -290,22 +282,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSArray<SWGPet>*"
completionBlock: ^(id data, NSError *error) {
completionBlock((NSArray<SWGPet>*)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSArray<SWGPet>*"
completionBlock: ^(id data, NSError *error) {
handler((NSArray<SWGPet>*)data, error);
}
];
}
@ -316,10 +307,8 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns NSArray<SWGPet>*
///
-(NSNumber*) findPetsByTagsWithCompletionBlock: (NSArray* /* NSString */) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock {
-(NSNumber*) findPetsByTagsWithTags: (NSArray* /* NSString */) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler {
@ -374,22 +363,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSArray<SWGPet>*"
completionBlock: ^(id data, NSError *error) {
completionBlock((NSArray<SWGPet>*)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSArray<SWGPet>*"
completionBlock: ^(id data, NSError *error) {
handler((NSArray<SWGPet>*)data, error);
}
];
}
@ -400,10 +388,8 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns SWGPet*
///
-(NSNumber*) getPetByIdWithCompletionBlock: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock {
-(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error)) handler {
// verify the required parameter 'petId' is set
@ -460,22 +446,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGPet*"
completionBlock: ^(id data, NSError *error) {
completionBlock((SWGPet*)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGPet*"
completionBlock: ^(id data, NSError *error) {
handler((SWGPet*)data, error);
}
];
}
@ -490,12 +475,10 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) updatePetWithFormWithCompletionBlock: (NSString*) petId
name: (NSString*) name
status: (NSString*) status
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
name: (NSString*) name
status: (NSString*) status
completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'petId' is set
@ -564,22 +547,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -592,11 +574,9 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) deletePetWithCompletionBlock: (NSNumber*) petId
apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId
apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'petId' is set
@ -656,22 +636,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"DELETE"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"DELETE"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -686,12 +665,10 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) uploadFileWithCompletionBlock: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata
file: (NSURL*) file
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata
file: (NSURL*) file
completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'petId' is set
@ -758,22 +735,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -784,10 +760,8 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns NSString*
///
-(NSNumber*) getPetByIdWithByteArrayWithCompletionBlock: (NSNumber*) petId
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock {
-(NSNumber*) getPetByIdWithByteArrayWithPetId: (NSNumber*) petId
completionHandler: (void (^)(NSString* output, NSError* error)) handler {
// verify the required parameter 'petId' is set
@ -844,22 +818,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSString*"
completionBlock: ^(id data, NSError *error) {
completionBlock((NSString*)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSString*"
completionBlock: ^(id data, NSError *error) {
handler((NSString*)data, error);
}
];
}
@ -870,10 +843,8 @@ static SWGPetApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) addPetUsingByteArrayWithCompletionBlock: (NSString*) body
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) addPetUsingByteArrayWithBody: (NSString*) body
completionHandler: (void (^)(NSError* error)) handler {
@ -922,22 +893,21 @@ static SWGPetApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}

View File

@ -27,9 +27,8 @@
///
///
/// @return NSDictionary* /* NSString, NSNumber */
-(NSNumber*) getInventoryWithCompletionBlock :
(void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error))completionBlock;
-(NSNumber*) getInventoryWithCompletionHandler:
(void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error)) handler;
///
@ -41,10 +40,8 @@
///
///
/// @return SWGOrder*
-(NSNumber*) placeOrderWithCompletionBlock :(SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock;
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
///
@ -56,10 +53,8 @@
///
///
/// @return SWGOrder*
-(NSNumber*) getOrderByIdWithCompletionBlock :(NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock;
-(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
///
@ -71,10 +66,8 @@
///
///
/// @return
-(NSNumber*) deleteOrderWithCompletionBlock :(NSString*) orderId
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
completionHandler: (void (^)(NSError* error)) handler;

View File

@ -74,9 +74,8 @@ static SWGStoreApi* singletonAPI = nil;
/// Returns a map of status codes to quantities
/// @returns NSDictionary* /* NSString, NSNumber */
///
-(NSNumber*) getInventoryWithCompletionBlock:
(void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error))completionBlock {
-(NSNumber*) getInventoryWithCompletionHandler:
(void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error)) handler {
@ -125,22 +124,21 @@ static SWGStoreApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSDictionary* /* NSString, NSNumber */"
completionBlock: ^(id data, NSError *error) {
completionBlock((NSDictionary* /* NSString, NSNumber */)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSDictionary* /* NSString, NSNumber */"
completionBlock: ^(id data, NSError *error) {
handler((NSDictionary* /* NSString, NSNumber */)data, error);
}
];
}
@ -151,10 +149,8 @@ static SWGStoreApi* singletonAPI = nil;
///
/// @returns SWGOrder*
///
-(NSNumber*) placeOrderWithCompletionBlock: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock {
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
@ -203,22 +199,21 @@ static SWGStoreApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGOrder*"
completionBlock: ^(id data, NSError *error) {
completionBlock((SWGOrder*)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGOrder*"
completionBlock: ^(id data, NSError *error) {
handler((SWGOrder*)data, error);
}
];
}
@ -229,10 +224,8 @@ static SWGStoreApi* singletonAPI = nil;
///
/// @returns SWGOrder*
///
-(NSNumber*) getOrderByIdWithCompletionBlock: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock {
-(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
// verify the required parameter 'orderId' is set
@ -289,22 +282,21 @@ static SWGStoreApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGOrder*"
completionBlock: ^(id data, NSError *error) {
completionBlock((SWGOrder*)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGOrder*"
completionBlock: ^(id data, NSError *error) {
handler((SWGOrder*)data, error);
}
];
}
@ -315,10 +307,8 @@ static SWGStoreApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) deleteOrderWithCompletionBlock: (NSString*) orderId
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'orderId' is set
@ -375,22 +365,21 @@ static SWGStoreApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"DELETE"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"DELETE"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}

View File

@ -28,10 +28,8 @@
///
///
/// @return
-(NSNumber*) createUserWithCompletionBlock :(SWGUser*) body
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) createUserWithBody: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler;
///
@ -43,10 +41,8 @@
///
///
/// @return
-(NSNumber*) createUsersWithArrayInputWithCompletionBlock :(NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler;
///
@ -58,10 +54,8 @@
///
///
/// @return
-(NSNumber*) createUsersWithListInputWithCompletionBlock :(NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler;
///
@ -74,11 +68,9 @@
///
///
/// @return NSString*
-(NSNumber*) loginUserWithCompletionBlock :(NSString*) username
password:(NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock;
-(NSNumber*) loginUserWithUsername: (NSString*) username
password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error)) handler;
///
@ -89,9 +81,8 @@
///
///
/// @return
-(NSNumber*) logoutUserWithCompletionBlock :
(void (^)(NSError* error))completionBlock;
-(NSNumber*) logoutUserWithCompletionHandler:
(void (^)(NSError* error)) handler;
///
@ -103,10 +94,8 @@
///
///
/// @return SWGUser*
-(NSNumber*) getUserByNameWithCompletionBlock :(NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock;
-(NSNumber*) getUserByNameWithUsername: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler;
///
@ -119,11 +108,9 @@
///
///
/// @return
-(NSNumber*) updateUserWithCompletionBlock :(NSString*) username
body:(SWGUser*) body
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler;
///
@ -135,10 +122,8 @@
///
///
/// @return
-(NSNumber*) deleteUserWithCompletionBlock :(NSString*) username
completionHandler: (void (^)(NSError* error))completionBlock;
-(NSNumber*) deleteUserWithUsername: (NSString*) username
completionHandler: (void (^)(NSError* error)) handler;

View File

@ -76,10 +76,8 @@ static SWGUserApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) createUserWithCompletionBlock: (SWGUser*) body
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) createUserWithBody: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler {
@ -128,22 +126,21 @@ static SWGUserApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -154,10 +151,8 @@ static SWGUserApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) createUsersWithArrayInputWithCompletionBlock: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler {
@ -206,22 +201,21 @@ static SWGUserApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -232,10 +226,8 @@ static SWGUserApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) createUsersWithListInputWithCompletionBlock: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler {
@ -284,22 +276,21 @@ static SWGUserApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -312,11 +303,9 @@ static SWGUserApi* singletonAPI = nil;
///
/// @returns NSString*
///
-(NSNumber*) loginUserWithCompletionBlock: (NSString*) username
password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock {
-(NSNumber*) loginUserWithUsername: (NSString*) username
password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error)) handler {
@ -373,22 +362,21 @@ static SWGUserApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSString*"
completionBlock: ^(id data, NSError *error) {
completionBlock((NSString*)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSString*"
completionBlock: ^(id data, NSError *error) {
handler((NSString*)data, error);
}
];
}
@ -397,9 +385,8 @@ static SWGUserApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) logoutUserWithCompletionBlock:
(void (^)(NSError* error))completionBlock {
-(NSNumber*) logoutUserWithCompletionHandler:
(void (^)(NSError* error)) handler {
@ -448,22 +435,21 @@ static SWGUserApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -474,10 +460,8 @@ static SWGUserApi* singletonAPI = nil;
///
/// @returns SWGUser*
///
-(NSNumber*) getUserByNameWithCompletionBlock: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock {
-(NSNumber*) getUserByNameWithUsername: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler {
// verify the required parameter 'username' is set
@ -534,22 +518,21 @@ static SWGUserApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGUser*"
completionBlock: ^(id data, NSError *error) {
completionBlock((SWGUser*)data, error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGUser*"
completionBlock: ^(id data, NSError *error) {
handler((SWGUser*)data, error);
}
];
}
@ -562,11 +545,9 @@ static SWGUserApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) updateUserWithCompletionBlock: (NSString*) username
body: (SWGUser*) body
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'username' is set
@ -623,22 +604,21 @@ static SWGUserApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"PUT"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"PUT"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}
@ -649,10 +629,8 @@ static SWGUserApi* singletonAPI = nil;
///
/// @returns void
///
-(NSNumber*) deleteUserWithCompletionBlock: (NSString*) username
completionHandler: (void (^)(NSError* error))completionBlock {
-(NSNumber*) deleteUserWithUsername: (NSString*) username
completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'username' is set
@ -709,22 +687,21 @@ static SWGUserApi* singletonAPI = nil;
return [self.apiClient requestWithCompletionBlock: resourcePath
method: @"DELETE"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
}
return [self.apiClient requestWithPath: resourcePath
method: @"DELETE"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
handler(error);
}
];
}

View File

@ -27,7 +27,7 @@
SWGPetApi *api = [[SWGPetApi alloc] init];
NSURL *file = [NSURL fileURLWithPath:@"/Users/geekerzp/tmp/test.jpg"];
[api uploadFileWithCompletionBlock:@2 additionalMetadata:@2 file:file completionHandler:^(NSError *error) {
[api uploadFileWithPetId:@2 additionalMetadata:@2 file:file completionHandler:^(NSError *error) {
NSLog(@"*** error: %@", error);
}];
}

View File

@ -35,12 +35,12 @@
XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetById"];
SWGPet* pet = [self createPet];
[api addPetWithCompletionBlock:pet completionHandler:^(NSError *error) {
[api addPetWithBody:pet completionHandler:^(NSError *error) {
if(error){
XCTFail(@"got error %@", error);
}
NSLog(@"%@", [pet _id]);
[api getPetByIdWithCompletionBlock:[pet _id] completionHandler:^(SWGPet *output, NSError *error) {
[api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) {
if(error){
XCTFail(@"got error %@", error);
}
@ -75,12 +75,12 @@
XCTestExpectation *expectation = [self expectationWithDescription:@"testUpdatePet"];
SWGPet* pet = [self createPet];
[api addPetWithCompletionBlock:pet completionHandler:^(NSError *error) {
[api addPetWithBody:pet completionHandler:^(NSError *error) {
if(error) {
XCTFail(@"got error %@", error);
}
else {
[api getPetByIdWithCompletionBlock:[NSString stringWithFormat:@"%@",[pet _id]] completionHandler:^(SWGPet *output, NSError *error) {
[api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) {
if(error) {
XCTFail(@"got error %@", error);
}
@ -94,12 +94,12 @@
[pet setName:@"programmer"];
[pet setStatus:@"confused"];
[api updatePetWithCompletionBlock:pet
[api updatePetWithBody:pet
completionHandler:^(NSError *error) {
if(error) {
XCTFail(@"got error %@", error);
}
[api getPetByIdWithCompletionBlock:[pet _id] completionHandler:^(SWGPet *output, NSError *error) {
[api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) {
if(error) {
XCTFail(@"got error %@", error);
}
@ -167,13 +167,13 @@ which causes an exception when deserializing the data
NSLog(@"%@", pet._id);
pet.tags = [[NSArray alloc] initWithObjects:tag, nil];
[api addPetWithCompletionBlock:pet completionHandler:^(NSError *error) {
[api addPetWithBody:pet completionHandler:^(NSError *error) {
if(error) {
XCTFail(@"got error %@", error);
}
NSArray* tags = [[NSArray alloc] initWithObjects:@"tony", nil];
[api findPetsByTagsWithCompletionBlock:tags completionHandler:^(NSArray *output, NSError *error) {
[api findPetsByTagsWithTags:tags completionHandler:^(NSArray *output, NSError *error) {
if(error){
XCTFail(@"got error %@", error);
}
@ -200,15 +200,15 @@ which causes an exception when deserializing the data
SWGPet* pet = [self createPet];
[api addPetWithCompletionBlock:pet completionHandler:^(NSError *error) {
[api addPetWithBody:pet completionHandler:^(NSError *error) {
if(error){
XCTFail(@"got error %@", error);
}
[api deletePetWithCompletionBlock:pet._id apiKey:@"" completionHandler:^(NSError *error) {
[api deletePetWithPetId:pet._id apiKey:@"" completionHandler:^(NSError *error) {
if(error){
XCTFail(@"got error %@", error);
}
[api getPetByIdWithCompletionBlock:[pet _id] completionHandler:^(SWGPet *output, NSError *error) {
[api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) {
if(error) {
// good
[expectation fulfill];
@ -228,7 +228,7 @@ which causes an exception when deserializing the data
NSURL *fileURL = [self createTempFile];
[api uploadFileWithCompletionBlock:@1 additionalMetadata:@"special-metadata" file:fileURL completionHandler:^(NSError *error) {
[api uploadFileWithPetId:@1 additionalMetadata:@"special-metadata" file:fileURL completionHandler:^(NSError *error) {
if(error) {
// good
XCTFail(@"expected a failure");
@ -246,7 +246,7 @@ which causes an exception when deserializing the data
NSURL *fileURL = [self createTempFile];
[api uploadFileWithCompletionBlock:@1 additionalMetadata:nil file:fileURL completionHandler:^(NSError *error) {
[api uploadFileWithPetId:@1 additionalMetadata:nil file:fileURL completionHandler:^(NSError *error) {
if (error) {
XCTFail(@"expected a failure");
}
@ -261,7 +261,7 @@ which causes an exception when deserializing the data
- (void)TestUploadWithoutFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithoutFile"];
[api uploadFileWithCompletionBlock:@1 additionalMetadata:@"special-metadata" file:nil completionHandler:^(NSError *error) {
[api uploadFileWithPetId:@1 additionalMetadata:@"special-metadata" file:nil completionHandler:^(NSError *error) {
if(error) {
XCTFail(@"failed to upload");

View File

@ -22,7 +22,7 @@
- (void)testGetInventory {
XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetByStatus"];
[self.api getInventoryWithCompletionBlock:^(NSDictionary *output, NSError *error) {
[self.api getInventoryWithCompletionHandler:^(NSDictionary *output, NSError *error) {
if (error) {
XCTFail(@"got error %@", error);

View File

@ -22,7 +22,7 @@
- (void)testLoginUser {
XCTestExpectation *expectation = [self expectationWithDescription:@"test login user"];
[self.api loginUserWithCompletionBlock:@"test username" password:@"test password" completionHandler:^(NSString *output, NSError *error) {
[self.api loginUserWithUsername:@"test username" password:@"test password" completionHandler:^(NSString *output, NSError *error) {
if (error) {
XCTFail(@"got error %@", error);
}