Merge branch 'develop_2.0' into python-enum

This commit is contained in:
geekerzp 2015-07-16 17:27:17 +08:00
commit 8746f1544b
126 changed files with 2795 additions and 2518 deletions

6
.gitignore vendored
View File

@ -31,8 +31,10 @@ samples/client/petstore/qt5cpp/PetStore/PetStore
samples/client/petstore/qt5cpp/PetStore/Makefile samples/client/petstore/qt5cpp/PetStore/Makefile
samples/client/petstore/java/hello.txt samples/client/petstore/java/hello.txt
samples/client/petstore/android-java/hello.txt samples/client/petstore/android-java/hello.txt
samples/client/petstore/objc/Build samples/client/petstore/objc/SwaggerClientTests/Build
samples/client/petstore/objc/Pods samples/client/petstore/objc/SwaggerClientTests/Pods
samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcworkspace
samples/client/petstore/objc/SwaggerClientTests/Podfile.lock
samples/server/petstore/nodejs/node_modules samples/server/petstore/nodejs/node_modules
target target
.idea .idea

View File

@ -18,43 +18,60 @@ import java.util.Set;
public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
protected Set<String> foundationClasses = new HashSet<String>(); protected Set<String> foundationClasses = new HashSet<String>();
protected String sourceFolder = "client"; protected String podName = "SwaggerClient";
protected String podVersion = "1.0.0";
protected String classPrefix = "SWG"; protected String classPrefix = "SWG";
protected String projectName = "SwaggerClient";
public ObjcClientCodegen() { public ObjcClientCodegen() {
super(); super();
outputFolder = "generated-code" + File.separator + "objc"; outputFolder = "generated-code" + File.separator + "objc";
modelTemplateFiles.put("model-header.mustache", ".h"); modelTemplateFiles.put("model-header.mustache", ".h");
modelTemplateFiles.put("model-body.mustache", ".m"); modelTemplateFiles.put("model-body.mustache", ".m");
apiTemplateFiles.put("api-header.mustache", ".h"); apiTemplateFiles.put("api-header.mustache", ".h");
apiTemplateFiles.put("api-body.mustache", ".m"); apiTemplateFiles.put("api-body.mustache", ".m");
templateDir = "objc"; templateDir = "objc";
modelPackage = "";
defaultIncludes = new HashSet<String>( defaultIncludes.clear();
Arrays.asList( defaultIncludes.add("bool");
"bool", defaultIncludes.add("BOOL");
"BOOL", defaultIncludes.add("int");
"int", defaultIncludes.add("NSURL");
"NSString", defaultIncludes.add("NSString");
"NSObject", defaultIncludes.add("NSObject");
"NSArray", defaultIncludes.add("NSArray");
"NSNumber", defaultIncludes.add("NSNumber");
"NSDate", defaultIncludes.add("NSDate");
"NSDictionary", defaultIncludes.add("NSDictionary");
"NSMutableArray", defaultIncludes.add("NSMutableArray");
"NSMutableDictionary") defaultIncludes.add("NSMutableDictionary");
);
languageSpecificPrimitives = new HashSet<String>( languageSpecificPrimitives.clear();
Arrays.asList( languageSpecificPrimitives.add("NSNumber");
"NSNumber", languageSpecificPrimitives.add("NSString");
"NSString", languageSpecificPrimitives.add("NSObject");
"NSObject", languageSpecificPrimitives.add("NSDate");
"NSDate", languageSpecificPrimitives.add("NSURL");
"bool", languageSpecificPrimitives.add("bool");
"BOOL") languageSpecificPrimitives.add("BOOL");
);
typeMapping.clear();
typeMapping.put("enum", "NSString");
typeMapping.put("Date", "NSDate");
typeMapping.put("DateTime", "NSDate");
typeMapping.put("boolean", "NSNumber");
typeMapping.put("string", "NSString");
typeMapping.put("integer", "NSNumber");
typeMapping.put("int", "NSNumber");
typeMapping.put("float", "NSNumber");
typeMapping.put("long", "NSNumber");
typeMapping.put("double", "NSNumber");
typeMapping.put("array", "NSArray");
typeMapping.put("map", "NSDictionary");
typeMapping.put("number", "NSNumber");
typeMapping.put("List", "NSArray");
typeMapping.put("object", "NSObject");
typeMapping.put("file", "NSURL");
// ref: http://www.tutorialspoint.com/objective_c/objective_c_basic_syntax.htm // ref: http://www.tutorialspoint.com/objective_c/objective_c_basic_syntax.htm
reservedWords = new HashSet<String>( reservedWords = new HashSet<String>(
@ -70,26 +87,10 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
"double", "protocol", "interface", "implementation", "double", "protocol", "interface", "implementation",
"NSObject", "NSInteger", "NSNumber", "CGFloat", "NSObject", "NSInteger", "NSNumber", "CGFloat",
"property", "nonatomic", "retain", "strong", "property", "nonatomic", "retain", "strong",
"weak", "unsafe_unretained", "readwrite", "readonly" "weak", "unsafe_unretained", "readwrite", "readonly",
"description"
)); ));
typeMapping = new HashMap<String, String>();
typeMapping.put("enum", "NSString");
typeMapping.put("Date", "NSDate");
typeMapping.put("DateTime", "NSDate");
typeMapping.put("boolean", "BOOL");
typeMapping.put("string", "NSString");
typeMapping.put("integer", "NSNumber");
typeMapping.put("int", "NSNumber");
typeMapping.put("float", "NSNumber");
typeMapping.put("long", "NSNumber");
typeMapping.put("double", "NSNumber");
typeMapping.put("array", "NSArray");
typeMapping.put("map", "NSDictionary");
typeMapping.put("number", "NSNumber");
typeMapping.put("List", "NSArray");
typeMapping.put("object", "NSObject");
importMapping = new HashMap<String, String>(); importMapping = new HashMap<String, String>();
foundationClasses = new HashSet<String>( foundationClasses = new HashSet<String>(
@ -98,15 +99,17 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
"NSObject", "NSObject",
"NSString", "NSString",
"NSDate", "NSDate",
"NSURL",
"NSDictionary") "NSDictionary")
); );
instantiationTypes.put("array", "NSMutableArray"); instantiationTypes.put("array", "NSMutableArray");
instantiationTypes.put("map", "NSMutableDictionary"); instantiationTypes.put("map", "NSMutableDictionary");
cliOptions.add(new CliOption("classPrefix", "prefix for generated classes")); cliOptions.clear();
cliOptions.add(new CliOption("sourceFolder", "source folder for generated code")); cliOptions.add(new CliOption("classPrefix", "prefix for generated classes (convention: Abbreviation of pod name e.g. `HN` for `HackerNews`), default: `SWG`"));
cliOptions.add(new CliOption("projectName", "name of the Xcode project in generated Podfile")); cliOptions.add(new CliOption("podName", "cocoapods package name (convention: CameCase), default: `SwaggerClient`"));
cliOptions.add(new CliOption("podVersion", "cocoapods package version, default: `1.0.0`"));
} }
public CodegenType getTag() { public CodegenType getTag() {
@ -125,35 +128,43 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
public void processOpts() { public void processOpts() {
super.processOpts(); super.processOpts();
if (additionalProperties.containsKey("sourceFolder")) { if (additionalProperties.containsKey("podName")) {
this.setSourceFolder((String) additionalProperties.get("sourceFolder")); setPodName((String) additionalProperties.get("podName"));
}
if (additionalProperties.containsKey("podVersion")) {
setPodVersion((String) additionalProperties.get("podVersion"));
} }
if (additionalProperties.containsKey("classPrefix")) { if (additionalProperties.containsKey("classPrefix")) {
this.setClassPrefix((String) additionalProperties.get("classPrefix")); setClassPrefix((String) additionalProperties.get("classPrefix"));
} }
if (additionalProperties.containsKey("projectName")) { additionalProperties.put("podName", podName);
this.setProjectName((String) additionalProperties.get("projectName")); additionalProperties.put("podVersion", podVersion);
} else { additionalProperties.put("classPrefix", classPrefix);
additionalProperties.put("projectName", projectName);
}
supportingFiles.add(new SupportingFile("SWGObject.h", sourceFolder, "SWGObject.h")); String swaggerFolder = podName;
supportingFiles.add(new SupportingFile("SWGObject.m", sourceFolder, "SWGObject.m"));
supportingFiles.add(new SupportingFile("SWGQueryParamCollection.h", sourceFolder, "SWGQueryParamCollection.h")); modelPackage = swaggerFolder;
supportingFiles.add(new SupportingFile("SWGQueryParamCollection.m", sourceFolder, "SWGQueryParamCollection.m")); apiPackage = swaggerFolder;
supportingFiles.add(new SupportingFile("SWGApiClient-header.mustache", sourceFolder, "SWGApiClient.h"));
supportingFiles.add(new SupportingFile("SWGApiClient-body.mustache", sourceFolder, "SWGApiClient.m")); supportingFiles.add(new SupportingFile("Object-header.mustache", swaggerFolder, classPrefix + "Object.h"));
supportingFiles.add(new SupportingFile("SWGJSONResponseSerializer-header.mustache", sourceFolder, "SWGJSONResponseSerializer.h")); supportingFiles.add(new SupportingFile("Object-body.mustache", swaggerFolder, classPrefix + "Object.m"));
supportingFiles.add(new SupportingFile("SWGJSONResponseSerializer-body.mustache", sourceFolder, "SWGJSONResponseSerializer.m")); supportingFiles.add(new SupportingFile("QueryParamCollection-header.mustache", swaggerFolder, classPrefix + "QueryParamCollection.h"));
supportingFiles.add(new SupportingFile("SWGFile.h", sourceFolder, "SWGFile.h")); supportingFiles.add(new SupportingFile("QueryParamCollection-body.mustache", swaggerFolder, classPrefix + "QueryParamCollection.m"));
supportingFiles.add(new SupportingFile("SWGFile.m", sourceFolder, "SWGFile.m")); supportingFiles.add(new SupportingFile("ApiClient-header.mustache", swaggerFolder, classPrefix + "ApiClient.h"));
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.m", sourceFolder, "JSONValueTransformer+ISO8601.m")); supportingFiles.add(new SupportingFile("ApiClient-body.mustache", swaggerFolder, classPrefix + "ApiClient.m"));
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.h", sourceFolder, "JSONValueTransformer+ISO8601.h")); supportingFiles.add(new SupportingFile("JSONResponseSerializer-header.mustache", swaggerFolder, classPrefix + "JSONResponseSerializer.h"));
supportingFiles.add(new SupportingFile("SWGConfiguration-body.mustache", sourceFolder, "SWGConfiguration.m")); supportingFiles.add(new SupportingFile("JSONResponseSerializer-body.mustache", swaggerFolder, classPrefix + "JSONResponseSerializer.m"));
supportingFiles.add(new SupportingFile("SWGConfiguration-header.mustache", sourceFolder, "SWGConfiguration.h")); supportingFiles.add(new SupportingFile("JSONRequestSerializer-body.mustache", swaggerFolder, classPrefix + "JSONRequestSerializer.m"));
supportingFiles.add(new SupportingFile("Podfile.mustache", "", "Podfile")); supportingFiles.add(new SupportingFile("JSONRequestSerializer-header.mustache", swaggerFolder, classPrefix + "JSONRequestSerializer.h"));
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.m", swaggerFolder, "JSONValueTransformer+ISO8601.m"));
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.h", swaggerFolder, "JSONValueTransformer+ISO8601.h"));
supportingFiles.add(new SupportingFile("Configuration-body.mustache", swaggerFolder, classPrefix + "Configuration.m"));
supportingFiles.add(new SupportingFile("Configuration-header.mustache", swaggerFolder, classPrefix + "Configuration.h"));
supportingFiles.add(new SupportingFile("podspec.mustache", "", podName + ".podspec"));
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
} }
@Override @Override
@ -285,11 +296,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override @Override
public String toModelImport(String name) { public String toModelImport(String name) {
if ("".equals(modelPackage())) { return name;
return name;
} else {
return modelPackage() + "." + name;
}
} }
@Override @Override
@ -299,12 +306,12 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override @Override
public String apiFileFolder() { public String apiFileFolder() {
return outputFolder + File.separator + sourceFolder; return outputFolder + File.separatorChar + apiPackage();
} }
@Override @Override
public String modelFileFolder() { public String modelFileFolder() {
return outputFolder + File.separator + sourceFolder; return outputFolder + File.separatorChar + modelPackage();
} }
@Override @Override
@ -359,15 +366,15 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
return camelize(operationId, true); return camelize(operationId, true);
} }
public void setSourceFolder(String sourceFolder) {
this.sourceFolder = sourceFolder;
}
public void setClassPrefix(String classPrefix) { public void setClassPrefix(String classPrefix) {
this.classPrefix = classPrefix; this.classPrefix = classPrefix;
} }
public void setProjectName(String projectName) { public void setPodName(String podName) {
this.projectName = projectName; this.podName = podName;
}
public void setPodVersion(String podVersion) {
this.podVersion = podVersion;
} }
} }

View File

@ -1,11 +1,8 @@
#import "SWGApiClient.h" #import "{{classPrefix}}ApiClient.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h"
#import "SWGConfiguration.h"
@implementation SWGApiClient @implementation {{classPrefix}}ApiClient
NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; NSString *const {{classPrefix}}ResponseObjectErrorKey = @"{{classPrefix}}ResponseObject";
static long requestId = 0; static long requestId = 0;
static bool offlineState = false; static bool offlineState = false;
@ -14,31 +11,38 @@ static bool cacheEnabled = false;
static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable; static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable;
static NSOperationQueue* sharedQueue; static NSOperationQueue* sharedQueue;
static void (^reachabilityChangeBlock)(int); static void (^reachabilityChangeBlock)(int);
static bool loggingEnabled = true;
#pragma mark - Log Methods #pragma mark - Log Methods
+(void)setLoggingEnabled:(bool) state { - (void)logResponse:(AFHTTPRequestOperation *)operation
loggingEnabled = state; forRequest:(NSURLRequest *)request
error:(NSError*)error {
{{classPrefix}}Configuration *config = [{{classPrefix}}Configuration sharedConfig];
NSString *message = [NSString stringWithFormat:@"\n[DEBUG] Request body \n~BEGIN~\n %@\n~END~\n"\
"[DEBUG] HTTP Response body \n~BEGIN~\n %@\n~END~\n",
[[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding],
operation.responseString];
if (config.loggingFileHanlder) {
[config.loggingFileHanlder seekToEndOfFile];
[config.loggingFileHanlder writeData:[message dataUsingEncoding:NSUTF8StringEncoding]];
}
NSLog(@"%@", message);
} }
- (void)logRequest:(NSURLRequest*)request { #pragma mark - Cache Methods
NSLog(@"request: %@", [self descriptionForRequest:request]);
}
- (void)logResponse:(id)data forRequest:(NSURLRequest*)request error:(NSError*)error { + (void) setCacheEnabled:(BOOL)enabled {
NSLog(@"request: %@ response: %@ ", [self descriptionForRequest:request], data ); cacheEnabled = enabled;
} }
#pragma mark -
+(void)clearCache { +(void)clearCache {
[[NSURLCache sharedURLCache] removeAllCachedResponses]; [[NSURLCache sharedURLCache] removeAllCachedResponses];
} }
+(void)setCacheEnabled:(BOOL)enabled { #pragma mark -
cacheEnabled = enabled;
}
+(void)configureCacheWithMemoryAndDiskCapacity: (unsigned long) memorySize +(void)configureCacheWithMemoryAndDiskCapacity: (unsigned long) memorySize
diskSize: (unsigned long) diskSize { diskSize: (unsigned long) diskSize {
@ -58,7 +62,7 @@ static bool loggingEnabled = true;
return sharedQueue; return sharedQueue;
} }
+(SWGApiClient *)sharedClientFromPool:(NSString *)baseUrl { +({{classPrefix}}ApiClient *)sharedClientFromPool:(NSString *)baseUrl {
static NSMutableDictionary *_pool = nil; static NSMutableDictionary *_pool = nil;
if (queuedRequests == nil) { if (queuedRequests == nil) {
queuedRequests = [[NSMutableSet alloc]init]; queuedRequests = [[NSMutableSet alloc]init];
@ -72,21 +76,21 @@ static bool loggingEnabled = true;
_pool = [[NSMutableDictionary alloc] init]; _pool = [[NSMutableDictionary alloc] init];
// initialize URL cache // initialize URL cache
[SWGApiClient configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024]; [{{classPrefix}}ApiClient configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024];
// configure reachability // configure reachability
[SWGApiClient configureCacheReachibilityForHost:baseUrl]; [{{classPrefix}}ApiClient configureCacheReachibilityForHost:baseUrl];
} }
@synchronized(self) { @synchronized(self) {
SWGApiClient * client = [_pool objectForKey:baseUrl]; {{classPrefix}}ApiClient * client = [_pool objectForKey:baseUrl];
if (client == nil) { if (client == nil) {
client = [[SWGApiClient alloc] initWithBaseURL:[NSURL URLWithString:baseUrl]]; client = [[{{classPrefix}}ApiClient alloc] initWithBaseURL:[NSURL URLWithString:baseUrl]];
[_pool setValue:client forKey:baseUrl ]; [_pool setValue:client forKey:baseUrl ];
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"new client for path %@", baseUrl); NSLog(@"new client for path %@", baseUrl);
} }
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"returning client for path %@", baseUrl); NSLog(@"returning client for path %@", baseUrl);
return client; return client;
} }
@ -149,15 +153,15 @@ static bool loggingEnabled = true;
+(NSNumber*) nextRequestId { +(NSNumber*) nextRequestId {
@synchronized(self) { @synchronized(self) {
long nextId = ++requestId; long nextId = ++requestId;
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"got id %ld", nextId); NSLog(@"got id %ld", nextId);
return [NSNumber numberWithLong:nextId]; return [NSNumber numberWithLong:nextId];
} }
} }
+(NSNumber*) queueRequest { +(NSNumber*) queueRequest {
NSNumber* requestId = [SWGApiClient nextRequestId]; NSNumber* requestId = [{{classPrefix}}ApiClient nextRequestId];
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"added %@ to request queue", requestId); NSLog(@"added %@ to request queue", requestId);
[queuedRequests addObject:requestId]; [queuedRequests addObject:requestId];
return requestId; return requestId;
@ -190,7 +194,7 @@ static bool loggingEnabled = true;
}]; }];
if(matchingItems.count == 1) { if(matchingItems.count == 1) {
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"removing request id %@", requestId); NSLog(@"removing request id %@", requestId);
[queuedRequests removeObject:requestId]; [queuedRequests removeObject:requestId];
return true; return true;
@ -221,31 +225,31 @@ static bool loggingEnabled = true;
} }
+(void) configureCacheReachibilityForHost:(NSString*)host { +(void) configureCacheReachibilityForHost:(NSString*)host {
[[SWGApiClient sharedClientFromPool:host].reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { [[{{classPrefix}}ApiClient sharedClientFromPool:host].reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
reachabilityStatus = status; reachabilityStatus = status;
switch (status) { switch (status) {
case AFNetworkReachabilityStatusUnknown: case AFNetworkReachabilityStatusUnknown:
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusUnknown"); NSLog(@"reachability changed to AFNetworkReachabilityStatusUnknown");
[SWGApiClient setOfflineState:true]; [{{classPrefix}}ApiClient setOfflineState:true];
break; break;
case AFNetworkReachabilityStatusNotReachable: case AFNetworkReachabilityStatusNotReachable:
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusNotReachable"); NSLog(@"reachability changed to AFNetworkReachabilityStatusNotReachable");
[SWGApiClient setOfflineState:true]; [{{classPrefix}}ApiClient setOfflineState:true];
break; break;
case AFNetworkReachabilityStatusReachableViaWWAN: case AFNetworkReachabilityStatusReachableViaWWAN:
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWWAN"); NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWWAN");
[SWGApiClient setOfflineState:false]; [{{classPrefix}}ApiClient setOfflineState:false];
break; break;
case AFNetworkReachabilityStatusReachableViaWiFi: case AFNetworkReachabilityStatusReachableViaWiFi:
if(loggingEnabled) if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWiFi"); NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWiFi");
[SWGApiClient setOfflineState:false]; [{{classPrefix}}ApiClient setOfflineState:false];
break; break;
default: default:
break; break;
@ -255,7 +259,7 @@ static bool loggingEnabled = true;
reachabilityChangeBlock(status); reachabilityChangeBlock(status);
} }
}]; }];
[[SWGApiClient sharedClientFromPool:host].reachabilityManager startMonitoring]; [[{{classPrefix}}ApiClient sharedClientFromPool:host].reachabilityManager startMonitoring];
} }
-(NSString*) pathWithQueryParamsToString:(NSString*) path -(NSString*) pathWithQueryParamsToString:(NSString*) path
@ -268,36 +272,35 @@ static bool loggingEnabled = true;
for(NSString * key in [queryParams keyEnumerator]){ for(NSString * key in [queryParams keyEnumerator]){
if(counter == 0) separator = @"?"; if(counter == 0) separator = @"?";
else separator = @"&"; else separator = @"&";
NSString * value;
id queryParam = [queryParams valueForKey:key]; id queryParam = [queryParams valueForKey:key];
if([queryParam isKindOfClass:[NSString class]]){ if([queryParam isKindOfClass:[NSString class]]){
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [SWGApiClient escape:[queryParams valueForKey:key]]]]; [{{classPrefix}}ApiClient escape:key], [{{classPrefix}}ApiClient escape:[queryParams valueForKey:key]]]];
} }
else if([queryParam isKindOfClass:[SWGQueryParamCollection class]]){ else if([queryParam isKindOfClass:[{{classPrefix}}QueryParamCollection class]]){
SWGQueryParamCollection * coll = (SWGQueryParamCollection*) queryParam; {{classPrefix}}QueryParamCollection * coll = ({{classPrefix}}QueryParamCollection*) queryParam;
NSArray* values = [coll values]; NSArray* values = [coll values];
NSString* format = [coll format]; NSString* format = [coll format];
if([format isEqualToString:@"csv"]) { if([format isEqualToString:@"csv"]) {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@","]]]]; [{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@","]]]];
} }
else if([format isEqualToString:@"tsv"]) { else if([format isEqualToString:@"tsv"]) {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@"\t"]]]]; [{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@"\t"]]]];
} }
else if([format isEqualToString:@"pipes"]) { else if([format isEqualToString:@"pipes"]) {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@"|"]]]]; [{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@"|"]]]];
} }
else if([format isEqualToString:@"multi"]) { else if([format isEqualToString:@"multi"]) {
for(id obj in values) { for(id obj in values) {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", obj]]]; [{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", obj]]];
counter += 1; counter += 1;
} }
@ -305,7 +308,7 @@ static bool loggingEnabled = true;
} }
else { else {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", [queryParams valueForKey:key]]]]; [{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", [queryParams valueForKey:key]]]];
} }
counter += 1; counter += 1;
@ -314,11 +317,6 @@ static bool loggingEnabled = true;
return requestUrl; return requestUrl;
} }
- (NSString*)descriptionForRequest:(NSURLRequest*)request {
return [[request URL] absoluteString];
}
/** /**
* Update header and query params based on authentication settings * Update header and query params based on authentication settings
*/ */
@ -333,7 +331,7 @@ static bool loggingEnabled = true;
NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers];
NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys];
SWGConfiguration *config = [SWGConfiguration sharedConfig]; {{classPrefix}}Configuration *config = [{{classPrefix}}Configuration sharedConfig];
for (NSString *auth in authSettings) { for (NSString *auth in authSettings) {
NSDictionary *authSetting = [[config authSettings] objectForKey:auth]; NSDictionary *authSetting = [[config authSettings] objectForKey:auth];
@ -359,8 +357,8 @@ static bool loggingEnabled = true;
NSMutableArray *resultArray = nil; NSMutableArray *resultArray = nil;
NSMutableDictionary *resultDict = nil; NSMutableDictionary *resultDict = nil;
// return nil if data is nil // return nil if data is nil or class is nil
if (!data) { if (!data || !class) {
return nil; return nil;
} }
@ -473,20 +471,112 @@ static bool loggingEnabled = true;
return nil; return nil;
} }
#pragma mark - Operation Methods
- (void) operationWithCompletionBlock: (NSURLRequest *)request
requestId: (NSNumber *) requestId
completionBlock: (void (^)(id, NSError *))completionBlock {
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id response) {
if([self executeRequestWithId:requestId]) {
if([[{{classPrefix}}Configuration sharedConfig] debug]) {
[self logResponse:operation forRequest:request error:nil];
}
completionBlock(response, nil);
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if(operation.responseObject) {
// Add in the (parsed) response body.
userInfo[{{classPrefix}}ResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if([[{{classPrefix}}Configuration sharedConfig] debug])
[self logResponse:nil forRequest:request error:augmentedError];
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
}
- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request
requestId: (NSNumber *) requestId
completionBlock: (void (^)(id, NSError *))completionBlock {
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id responseObject) {
{{classPrefix}}Configuration *config = [{{classPrefix}}Configuration sharedConfig];
NSString *directory = nil;
if (config.tempFolderPath) {
directory = config.tempFolderPath;
}
else {
directory = NSTemporaryDirectory();
}
NSDictionary *headers = operation.response.allHeaderFields;
NSString *filename = nil;
if ([headers objectForKey:@"Content-Disposition"]) {
NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?";
NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern
options:NSRegularExpressionCaseInsensitive
error:nil];
NSString *contentDispositionHeader = [headers objectForKey:@"Content-Disposition"];
NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader
options:0
range:NSMakeRange(0, [contentDispositionHeader length])];
filename = [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]];
}
else {
filename = [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]];
}
NSString *filepath = [directory stringByAppendingPathComponent:filename];
NSURL *file = [NSURL fileURLWithPath:filepath];
[operation.responseData writeToURL:file atomically:YES];
completionBlock(file, nil);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if ([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if (operation.responseObject) {
userInfo[{{classPrefix}}ResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if ([[{{classPrefix}}Configuration sharedConfig] debug]) {
[self logResponse:nil forRequest:request error:augmentedError];
}
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
}
#pragma mark - Perform Request Methods #pragma mark - Perform Request Methods
-(NSNumber*) requestWithCompletionBlock: (NSString*) path -(NSNumber*) requestWithCompletionBlock: (NSString*) path
method: (NSString*) method method: (NSString*) method
queryParams: (NSDictionary*) queryParams queryParams: (NSDictionary*) queryParams
formParams: (NSDictionary *) formParams
files: (NSDictionary *) files
body: (id) body body: (id) body
headerParams: (NSDictionary*) headerParams headerParams: (NSDictionary*) headerParams
authSettings: (NSArray *) authSettings authSettings: (NSArray *) authSettings
requestContentType: (NSString*) requestContentType requestContentType: (NSString*) requestContentType
responseContentType: (NSString*) responseContentType responseContentType: (NSString*) responseContentType
responseType: (NSString *) responseType
completionBlock: (void (^)(id, NSError *))completionBlock { completionBlock: (void (^)(id, NSError *))completionBlock {
// setting request serializer // setting request serializer
if ([requestContentType isEqualToString:@"application/json"]) { if ([requestContentType isEqualToString:@"application/json"]) {
self.requestSerializer = [AFJSONRequestSerializer serializer]; self.requestSerializer = [{{classPrefix}}JSONRequestSerializer serializer];
} }
else if ([requestContentType isEqualToString:@"application/x-www-form-urlencoded"]) { else if ([requestContentType isEqualToString:@"application/x-www-form-urlencoded"]) {
self.requestSerializer = [AFHTTPRequestSerializer serializer]; self.requestSerializer = [AFHTTPRequestSerializer serializer];
@ -500,7 +590,7 @@ static bool loggingEnabled = true;
// setting response serializer // setting response serializer
if ([responseContentType isEqualToString:@"application/json"]) { if ([responseContentType isEqualToString:@"application/json"]) {
self.responseSerializer = [SWGJSONResponseSerializer serializer]; self.responseSerializer = [{{classPrefix}}JSONResponseSerializer serializer];
} }
else { else {
self.responseSerializer = [AFHTTPResponseSerializer serializer]; self.responseSerializer = [AFHTTPResponseSerializer serializer];
@ -510,68 +600,42 @@ static bool loggingEnabled = true;
[self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings];
NSMutableURLRequest * request = nil; NSMutableURLRequest * request = nil;
if (body != nil && [body isKindOfClass:[NSArray class]]){ NSString* pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
SWGFile * file; NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
NSMutableDictionary * params = [[NSMutableDictionary alloc] init]; if (files.count > 0) {
for(id obj in body) { request = [self.requestSerializer multipartFormRequestWithMethod:@"POST"
if([obj isKindOfClass:[SWGFile class]]) { URLString:urlString
file = (SWGFile*) obj; parameters:nil
requestContentType = @"multipart/form-data"; constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
} [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
else if([obj isKindOfClass:[NSDictionary class]]) { NSData *data = [obj dataUsingEncoding:NSUTF8StringEncoding];
for(NSString * key in obj) { [formData appendPartWithFormData:data name:key];
params[key] = obj[key]; }];
} [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
} NSURL *filePath = (NSURL *)obj;
} [formData appendPartWithFileURL:filePath name:key error:nil];
NSString * urlString = [[NSURL URLWithString:path relativeToURL:self.baseURL] absoluteString]; }];
} error:nil];
// request with multipart form
if([requestContentType isEqualToString:@"multipart/form-data"]) {
request = [self.requestSerializer multipartFormRequestWithMethod: @"POST"
URLString: urlString
parameters: nil
constructingBodyWithBlock: ^(id<AFMultipartFormData> formData) {
for(NSString * key in params) {
NSData* data = [params[key] dataUsingEncoding:NSUTF8StringEncoding];
[formData appendPartWithFormData: data name: key];
}
if (file) {
[formData appendPartWithFileData: [file data]
name: [file paramName]
fileName: [file name]
mimeType: [file mimeType]];
}
}
error:nil];
}
// request with form parameters or json
else {
NSString* pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:params
error:nil];
}
} }
else { else {
NSString * pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams]; if (formParams) {
NSString * urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; request = [self.requestSerializer requestWithMethod:method
URLString:urlString
request = [self.requestSerializer requestWithMethod: method parameters:formParams
URLString: urlString error:nil];
parameters: body }
error: nil]; if (body) {
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:body
error:nil];
}
} }
BOOL hasHeaderParams = false; BOOL hasHeaderParams = false;
if(headerParams != nil && [headerParams count] > 0) if(headerParams != nil && [headerParams count] > 0) {
hasHeaderParams = true; hasHeaderParams = true;
}
if(offlineState) { if(offlineState) {
NSLog(@"%@ cache forced", path); NSLog(@"%@ cache forced", path);
[request setCachePolicy:NSURLRequestReturnCacheDataDontLoad]; [request setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
@ -585,17 +649,7 @@ static bool loggingEnabled = true;
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
} }
if(hasHeaderParams){
if(body != nil) {
if([body isKindOfClass:[NSDictionary class]] || [body isKindOfClass:[NSArray class]]){
[self.requestSerializer setValue:requestContentType forHTTPHeaderField:@"Content-Type"];
}
else if ([body isKindOfClass:[SWGFile class]]){}
else {
NSAssert(false, @"unsupported post type!");
}
}
if(headerParams != nil){
for(NSString * key in [headerParams keyEnumerator]){ for(NSString * key in [headerParams keyEnumerator]){
[request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key];
} }
@ -606,31 +660,17 @@ static bool loggingEnabled = true;
// Always disable cookies! // Always disable cookies!
[request setHTTPShouldHandleCookies:NO]; [request setHTTPShouldHandleCookies:NO];
NSNumber* requestId = [SWGApiClient queueRequest]; NSNumber* requestId = [{{classPrefix}}ApiClient queueRequest];
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request if ([responseType isEqualToString:@"NSURL*"]) {
success:^(AFHTTPRequestOperation *operation, id response) { [self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) {
if([self executeRequestWithId:requestId]) { completionBlock(data, error);
if(self.logServerResponses) { }];
[self logResponse:response forRequest:request error:nil]; }
} else {
completionBlock(response, nil); [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) {
} completionBlock([self deserialize:data class:responseType], error);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { }];
if([self executeRequestWithId:requestId]) { }
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if(operation.responseObject) {
// Add in the (parsed) response body.
userInfo[SWGResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if(self.logServerResponses)
[self logResponse:nil forRequest:request error:augmentedError];
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
return requestId; return requestId;
} }
@ -639,8 +679,3 @@ static bool loggingEnabled = true;

View File

@ -1,7 +1,11 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <ISO8601/ISO8601.h> #import <ISO8601/ISO8601.h>
#import "AFHTTPRequestOperationManager.h" #import <AFNetworking/AFHTTPRequestOperationManager.h>
#import "SWGJSONResponseSerializer.h" #import "{{classPrefix}}JSONResponseSerializer.h"
#import "{{classPrefix}}JSONRequestSerializer.h"
#import "{{classPrefix}}QueryParamCollection.h"
#import "{{classPrefix}}Configuration.h"
{{#models}}{{#model}}#import "{{classname}}.h" {{#models}}{{#model}}#import "{{classname}}.h"
{{/model}}{{/models}} {{/model}}{{/models}}
@ -11,18 +15,13 @@
* *
* The corresponding value is the parsed response body for an HTTP error. * The corresponding value is the parsed response body for an HTTP error.
*/ */
extern NSString *const SWGResponseObjectErrorKey; extern NSString *const {{classPrefix}}ResponseObjectErrorKey;
@interface SWGApiClient : AFHTTPRequestOperationManager @interface {{classPrefix}}ApiClient : AFHTTPRequestOperationManager
@property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy; @property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
@property(nonatomic, assign) NSTimeInterval timeoutInterval; @property(nonatomic, assign) NSTimeInterval timeoutInterval;
@property(nonatomic, assign) BOOL logRequests;
@property(nonatomic, assign) BOOL logCacheHits;
@property(nonatomic, assign) BOOL logServerResponses;
@property(nonatomic, assign) BOOL logJSON;
@property(nonatomic, assign) BOOL logHTTP;
@property(nonatomic, readonly) NSOperationQueue* queue; @property(nonatomic, readonly) NSOperationQueue* queue;
/** /**
@ -30,9 +29,9 @@ extern NSString *const SWGResponseObjectErrorKey;
* *
* @param baseUrl The base url of api client. * @param baseUrl The base url of api client.
* *
* @return The SWGApiClient instance. * @return The {{classPrefix}}ApiClient instance.
*/ */
+(SWGApiClient *)sharedClientFromPool:(NSString *)baseUrl; +({{classPrefix}}ApiClient *)sharedClientFromPool:(NSString *)baseUrl;
/** /**
* Get the operations queue * Get the operations queue
@ -41,13 +40,6 @@ extern NSString *const SWGResponseObjectErrorKey;
*/ */
+(NSOperationQueue*) sharedQueue; +(NSOperationQueue*) sharedQueue;
/**
* Turn on logging
*
* @param state logging state, must be `YES` or `NO`
*/
+(void)setLoggingEnabled:(bool) state;
/** /**
* Clear Cache * Clear Cache
*/ */
@ -121,7 +113,7 @@ extern NSString *const SWGResponseObjectErrorKey;
/** /**
* Set the client reachability strategy * Set the client reachability strategy
* *
* @param host The host of SWGApiClient. * @param host The host of {{classPrefix}}ApiClient.
*/ */
+(void) configureCacheReachibilityForHost:(NSString*)host; +(void) configureCacheReachibilityForHost:(NSString*)host;
@ -171,6 +163,17 @@ extern NSString *const SWGResponseObjectErrorKey;
*/ */
- (id) deserialize:(id) data class:(NSString *) class; - (id) deserialize:(id) data class:(NSString *) class;
/**
* Logging request and response
*
* @param operation AFHTTPRequestOperation for the HTTP request.
* @param request The HTTP request.
* @param error The error of the HTTP request.
*/
- (void)logResponse:(AFHTTPRequestOperation *)operation
forRequest:(NSURLRequest *)request
error:(NSError *)error;
/** /**
* Perform request * Perform request
* *
@ -189,15 +192,14 @@ extern NSString *const SWGResponseObjectErrorKey;
-(NSNumber*) requestWithCompletionBlock:(NSString*) path -(NSNumber*) requestWithCompletionBlock:(NSString*) path
method:(NSString*) method method:(NSString*) method
queryParams:(NSDictionary*) queryParams queryParams:(NSDictionary*) queryParams
formParams:(NSDictionary *) formParams
files:(NSDictionary *) files
body:(id) body body:(id) body
headerParams:(NSDictionary*) headerParams headerParams:(NSDictionary*) headerParams
authSettings: (NSArray *) authSettings authSettings: (NSArray *) authSettings
requestContentType:(NSString*) requestContentType requestContentType:(NSString*) requestContentType
responseContentType:(NSString*) responseContentType responseContentType:(NSString*) responseContentType
responseType:(NSString *) responseType
completionBlock:(void (^)(id, NSError *))completionBlock; completionBlock:(void (^)(id, NSError *))completionBlock;
@end @end

View File

@ -1,18 +1,18 @@
#import "SWGConfiguration.h" #import "{{classPrefix}}Configuration.h"
@interface SWGConfiguration () @interface {{classPrefix}}Configuration ()
@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableApiKey; @property (readwrite, nonatomic, strong) NSMutableDictionary *mutableApiKey;
@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix; @property (readwrite, nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix;
@end @end
@implementation SWGConfiguration @implementation {{classPrefix}}Configuration
#pragma mark - Singletion Methods #pragma mark - Singletion Methods
+ (instancetype) sharedConfig { + (instancetype) sharedConfig {
static SWGConfiguration *shardConfig = nil; static {{classPrefix}}Configuration *shardConfig = nil;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
shardConfig = [[self alloc] init]; shardConfig = [[self alloc] init];
@ -27,6 +27,9 @@
if (self) { if (self) {
self.username = @""; self.username = @"";
self.password = @""; self.password = @"";
self.tempFolderPath = nil;
self.debug = NO;
self.loggingFile = nil;
self.mutableApiKey = [NSMutableDictionary dictionary]; self.mutableApiKey = [NSMutableDictionary dictionary];
self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; self.mutableApiKeyPrefix = [NSMutableDictionary dictionary];
} }
@ -65,6 +68,20 @@
[self.mutableApiKeyPrefix setValue:value forKey:field]; [self.mutableApiKeyPrefix setValue:value forKey:field];
} }
- (void) setLoggingFile:(NSString *)loggingFile {
// close old file handler
if ([self.loggingFileHanlder isKindOfClass:[NSFileHandle class]]) {
[self.loggingFileHanlder closeFile];
}
_loggingFile = loggingFile;
self.loggingFileHanlder = [NSFileHandle fileHandleForWritingAtPath:_loggingFile];
if (self.loggingFileHanlder == nil) {
[[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil];
self.loggingFileHanlder = [NSFileHandle fileHandleForWritingAtPath:_loggingFile];
}
}
#pragma mark - Getter Methods #pragma mark - Getter Methods
- (NSDictionary *) apiKey { - (NSDictionary *) apiKey {
@ -78,21 +95,14 @@
#pragma mark - #pragma mark -
- (NSDictionary *) authSettings { - (NSDictionary *) authSettings {
return @{ {{#authMethods}}{{#isApiKey}} return @{
@"{{name}}": @{ @"api_key": @{
@"type": @"api_key", @"type": @"api_key",
@"in": {{#isKeyInHeader}}@"header"{{/isKeyInHeader}}{{#isKeyInQuery}}@"query"{{/isKeyInQuery}},
@"key": @"{{keyParamName}}",
@"value": [self getApiKeyWithPrefix:@"{{keyParamName}}"]
},
{{/isApiKey}}{{#isBasic}}
@"{{name}}": @{
@"type": @"basic",
@"in": @"header", @"in": @"header",
@"key": @"Authorization", @"key": @"api_key",
@"value": [self getBasicAuthToken] @"value": [self getApiKeyWithPrefix:@"api_key"]
}, },
{{/isBasic}}{{/authMethods}}
}; };
} }

View File

@ -1,6 +1,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface SWGConfiguration : NSObject @interface {{classPrefix}}Configuration : NSObject
/** /**
@ -23,6 +23,18 @@
@property (nonatomic) NSString *username; @property (nonatomic) NSString *username;
@property (nonatomic) NSString *password; @property (nonatomic) NSString *password;
/**
* Temp folder for file download
*/
@property (nonatomic) NSString *tempFolderPath;
/**
* Logging Settings
*/
@property (nonatomic) BOOL debug;
@property (nonatomic) NSString *loggingFile;
@property (nonatomic) NSFileHandle *loggingFileHanlder;
/** /**
* Get configuration singleton instance * Get configuration singleton instance
*/ */

View File

@ -0,0 +1,35 @@
#import "{{classPrefix}}JSONRequestSerializer.h"
@implementation {{classPrefix}}JSONRequestSerializer
///
/// When customize a request serializer,
/// the serializer must conform the protocol `AFURLRequestSerialization`
/// and implements the protocol method `requestBySerializingRequest:withParameters:error:`
///
/// @param request The original request.
/// @param parameters The parameters to be encoded.
/// @param error The error that occurred while attempting to encode the request parameters.
///
/// @return A serialized request.
///
- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
withParameters:(id)parameters
error:(NSError *__autoreleasing *)error
{
// If the body data which will be serialized isn't NSArray or NSDictionary
// then put the data in the http request body directly.
if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) {
return [super requestBySerializingRequest:request withParameters:parameters error:error];
} else {
NSMutableURLRequest *mutableRequest = [request mutableCopy];
if (parameters) {
[mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]];
}
return mutableRequest;
}
}
@end

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
#import <AFNetworking/AFURLRequestSerialization.h>
@interface {{classPrefix}}JSONRequestSerializer : AFJSONRequestSerializer
@end

View File

@ -1,4 +1,4 @@
#import "SWGJSONResponseSerializer.h" #import "{{classPrefix}}JSONResponseSerializer.h"
static BOOL JSONParseError(NSError *error) { static BOOL JSONParseError(NSError *error) {
if ([error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840) { if ([error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840) {
@ -8,7 +8,7 @@ static BOOL JSONParseError(NSError *error) {
return NO; return NO;
} }
@implementation SWGJSONResponseSerializer @implementation {{classPrefix}}JSONResponseSerializer
/// ///
/// When customize a response serializer, /// When customize a response serializer,

View File

@ -1,6 +1,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <AFNetworking/AFURLResponseSerialization.h> #import <AFNetworking/AFURLResponseSerialization.h>
@interface SWGJSONResponseSerializer : AFJSONResponseSerializer @interface {{classPrefix}}JSONResponseSerializer : AFJSONResponseSerializer
@end @end

View File

@ -0,0 +1,4 @@
#import "{{classPrefix}}Object.h"
@implementation {{classPrefix}}Object
@end

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
#import <JSONModel/JSONModel.h>
@interface {{classPrefix}}Object : JSONModel
@end

View File

@ -1,5 +0,0 @@
platform :ios, '6.0'
xcodeproj '{{projectName}}/{{projectName}}.xcodeproj'
pod 'AFNetworking', '~> 2.1'
pod 'JSONModel', '~> 1.0'
pod 'ISO8601'

View File

@ -1,6 +1,6 @@
#import "SWGQueryParamCollection.h" #import "{{classPrefix}}QueryParamCollection.h"
@implementation SWGQueryParamCollection @implementation {{classPrefix}}QueryParamCollection
@synthesize values = _values; @synthesize values = _values;
@synthesize format = _format; @synthesize format = _format;

View File

@ -1,6 +1,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface SWGQueryParamCollection : NSObject @interface {{classPrefix}}QueryParamCollection : NSObject
@property(nonatomic, readonly) NSArray* values; @property(nonatomic, readonly) NSArray* values;
@property(nonatomic, readonly) NSString* format; @property(nonatomic, readonly) NSString* format;

View File

@ -0,0 +1,19 @@
# {{podName}}
## Requirements
The API client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project.
## Installation
To install it, put the API client library in your project and then simply add the following line to your Podfile:
```ruby
pod "{{podName}}", :path => "/path/to/lib"
```
## Author
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
{{/hasMore}}{{/apis}}{{/apiInfo}}

View File

@ -1,14 +0,0 @@
#import <Foundation/Foundation.h>
@interface SWGFile : NSObject
@property(nonatomic, readonly) NSString* name;
@property(nonatomic, readonly) NSString* mimeType;
@property(nonatomic, readonly) NSData* data;
@property(nonatomic) NSString* paramName;
- (id) initWithNameData: (NSString*) filename
mimeType: (NSString*) mimeType
data: (NSData*) data;
@end

View File

@ -1,26 +0,0 @@
#import "SWGFile.h"
@implementation SWGFile
@synthesize name = _name;
@synthesize mimeType = _mimeType;
@synthesize data = _data;
- (id) init {
self = [super init];
return self;
}
- (id) initWithNameData: (NSString*) filename
mimeType: (NSString*) fileMimeType
data: (NSData*) data {
self = [super init];
if(self) {
_name = filename;
_mimeType = fileMimeType;
_data = data;
}
return self;
}
@end

View File

@ -1,7 +1,6 @@
{{#operations}} {{#operations}}
#import "{{classname}}.h" #import "{{classname}}.h"
#import "SWGFile.h" #import "{{classPrefix}}QueryParamCollection.h"
#import "SWGQueryParamCollection.h"
{{#imports}}#import "{{import}}.h" {{#imports}}#import "{{import}}.h"
{{/imports}} {{/imports}}
{{newline}} {{newline}}
@ -19,20 +18,20 @@ static NSString * basePath = @"{{basePath}}";
- (id) init { - (id) init {
self = [super init]; self = [super init];
if (self) { if (self) {
self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; self.apiClient = [{{classPrefix}}ApiClient sharedClientFromPool:basePath];
self.defaultHeaders = [NSMutableDictionary dictionary]; self.defaultHeaders = [NSMutableDictionary dictionary];
} }
return self; return self;
} }
- (id) initWithApiClient:(SWGApiClient *)apiClient { - (id) initWithApiClient:({{classPrefix}}ApiClient *)apiClient {
self = [super init]; self = [super init];
if (self) { if (self) {
if (apiClient) { if (apiClient) {
self.apiClient = apiClient; self.apiClient = apiClient;
} }
else { else {
self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; self.apiClient = [{{classPrefix}}ApiClient sharedClientFromPool:basePath];
} }
self.defaultHeaders = [NSMutableDictionary dictionary]; self.defaultHeaders = [NSMutableDictionary dictionary];
} }
@ -69,7 +68,7 @@ static NSString * basePath = @"{{basePath}}";
} }
-(unsigned long) requestQueueSize { -(unsigned long) requestQueueSize {
return [SWGApiClient requestQueueSize]; return [{{classPrefix}}ApiClient requestQueueSize];
} }
#pragma mark - Api Methods #pragma mark - Api Methods
@ -84,12 +83,14 @@ static NSString * basePath = @"{{basePath}}";
/// ///
-(NSNumber*) {{nickname}}WithCompletionBlock{{^allParams}}: {{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}} -(NSNumber*) {{nickname}}WithCompletionBlock{{^allParams}}: {{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}
{{/allParams}} {{/allParams}}
{{#returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock{{/returnBaseType}} {{#returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock { {{/returnBaseType}}
{{^returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock{{/returnBaseType}} { {{^returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock { {{/returnBaseType}}
{{#allParams}}{{#required}} {{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set // verify the required parameter '{{paramName}}' is set
NSAssert({{paramName}} != nil, @"Missing the required parameter `{{paramName}}` when calling {{nickname}}"); if ({{paramName}} == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `{{paramName}}` when calling `{{nickname}}`"];
}
{{/required}}{{/allParams}} {{/required}}{{/allParams}}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@{{path}}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@{{path}}", basePath];
@ -98,13 +99,13 @@ static NSString * basePath = @"{{basePath}}";
if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound)
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"];
{{#pathParams}}[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"{{baseName}}", @"}"]] withString: [SWGApiClient escape:{{paramName}}]]; {{#pathParams}}[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"{{baseName}}", @"}"]] withString: [{{classPrefix}}ApiClient escape:{{paramName}}]];
{{/pathParams}} {{/pathParams}}
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
{{#queryParams}}if({{paramName}} != nil) { {{#queryParams}}if({{paramName}} != nil) {
{{#collectionFormat}} {{#collectionFormat}}
queryParams[@"{{baseName}}"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: {{baseName}} format: @"{{collectionFormat}}"]; queryParams[@"{{baseName}}"] = [[{{classPrefix}}QueryParamCollection alloc] initWithValuesAndFormat: {{baseName}} format: @"{{collectionFormat}}"];
{{/collectionFormat}} {{/collectionFormat}}
{{^collectionFormat}}queryParams[@"{{baseName}}"] = {{paramName}};{{/collectionFormat}} {{^collectionFormat}}queryParams[@"{{baseName}}"] = {{paramName}};{{/collectionFormat}}
} }
@ -114,9 +115,9 @@ static NSString * basePath = @"{{basePath}}";
{{#headerParams}}if({{paramName}} != nil) {{#headerParams}}if({{paramName}} != nil)
headerParams[@"{{baseName}}"] = {{paramName}}; headerParams[@"{{baseName}}"] = {{paramName}};
{{/headerParams}} {{/headerParams}}
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]]; headerParams[@"Accept"] = [{{classPrefix}}ApiClient selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
} }
@ -131,62 +132,39 @@ static NSString * basePath = @"{{basePath}}";
} }
// request content type // request content type
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]]; NSString *requestContentType = [{{classPrefix}}ApiClient selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]];
// Authentication setting // Authentication setting
NSArray *authSettings = @[{{#authMethods}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}]; NSArray *authSettings = @[{{#authMethods}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}];
id bodyDictionary = nil;
{{#bodyParam}}
id __body = {{paramName}};
if(__body != nil && [__body isKindOfClass:[NSArray class]]){ id bodyParam = nil;
NSMutableArray * objs = [[NSMutableArray alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
for (id dict in (NSArray*)__body) { NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
{{#bodyParam}}
bodyParam = {{paramName}};
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) { if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]]; [objs addObject:[({{classPrefix}}Object*)dict toDictionary]];
} }
else{ else{
[objs addObject:dict]; [objs addObject:dict];
} }
} }
bodyDictionary = objs; bodyParam = objs;
} }
else if([__body respondsToSelector:@selector(toDictionary)]) { else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary]; bodyParam = [({{classPrefix}}Object*)bodyParam toDictionary];
} }
else if([__body isKindOfClass:[NSString class]]) { {{/bodyParam}}{{^bodyParam}}
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
{{/bodyParam}}
{{^bodyParam}}
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
{{#formParams}} {{#formParams}}
{{#notFile}} {{#notFile}}
formParams[@"{{paramName}}"] = {{paramName}}; formParams[@"{{paramName}}"] = {{paramName}};
{{/notFile}}{{#isFile}} {{/notFile}}{{#isFile}}
requestContentType = @"multipart/form-data"; files[@"{{paramName}}"] = {{paramName}};
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
if({{paramName}} != nil) {
[bodyDictionary addObject:{{paramName}}];
{{paramName}}.paramName = @"{{baseName}}";
}
{{/isFile}} {{/isFile}}
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
{{/formParams}} {{/formParams}}
{{/bodyParam}} {{/bodyParam}}
@ -200,14 +178,17 @@ static NSString * basePath = @"{{basePath}}";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"{{httpMethod}}" method: @"{{httpMethod}}"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: {{^returnType}}nil{{/returnType}}{{#returnType}}@"{{{ returnType }}}"{{/returnType}}
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
{{^returnType}}completionBlock(error);{{/returnType}} {{^returnType}}completionBlock(error);{{/returnType}}
{{#returnType}}completionBlock([self.apiClient deserialize: data class:@"{{{returnType}}}"], error);{{/returnType}} {{#returnType}}completionBlock(({{{ returnType }}})data, error);{{/returnType}}
} }
]; ];
} }
@ -217,6 +198,3 @@ static NSString * basePath = @"{{basePath}}";
{{newline}} {{newline}}
{{/operations}} {{/operations}}
@end @end

View File

@ -1,16 +1,16 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
{{#imports}}#import "{{import}}.h" {{#imports}}#import "{{import}}.h"
{{/imports}} {{/imports}}
#import "SWGObject.h" #import "{{classPrefix}}Object.h"
#import "SWGApiClient.h" #import "{{classPrefix}}ApiClient.h"
{{newline}} {{newline}}
{{#operations}} {{#operations}}
@interface {{classname}}: NSObject @interface {{classname}}: NSObject
@property(nonatomic, assign)SWGApiClient *apiClient; @property(nonatomic, assign){{classPrefix}}ApiClient *apiClient;
-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; -(instancetype) initWithApiClient:({{classPrefix}}ApiClient *)apiClient;
-(void) addHeader:(NSString*)value forKey:(NSString*)key; -(void) addHeader:(NSString*)value forKey:(NSString*)key;
-(unsigned long) requestQueueSize; -(unsigned long) requestQueueSize;
+({{classname}}*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; +({{classname}}*) apiWithHeader:(NSString*)headerValue key:(NSString*)key;

View File

@ -1,5 +1,5 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "SWGObject.h" #import "{{classPrefix}}Object.h"
{{#imports}}#import "{{import}}.h" {{#imports}}#import "{{import}}.h"
{{/imports}} {{/imports}}
{{newline}} {{newline}}
@ -9,7 +9,7 @@
@protocol {{classname}} @protocol {{classname}}
@end @end
@interface {{classname}} : SWGObject @interface {{classname}} : {{classPrefix}}Object
{{#vars}} {{#vars}}
{{#description}}/* {{{description}}} {{^required}}[optional]{{/required}} {{#description}}/* {{{description}}} {{^required}}[optional]{{/required}}

View File

@ -0,0 +1,31 @@
#
# Be sure to run `pod lib lint {{podName}}.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = "{{podName}}"
s.version = "{{podVersion}}"
{{#apiInfo}}{{#apis}}{{^hasMore}}
s.summary = "{{appName}}"
s.description = <<-DESC
{{appDescription}}
DESC
{{/hasMore}}{{/apis}}{{/apiInfo}}
s.platform = :ios, '7.0'
s.requires_arc = true
s.framework = 'SystemConfiguration'
s.source_files = '{{podName}}/**/*'
s.public_header_files = '{{podName}}/**/*.h'
s.dependency 'AFNetworking', '~> 2.3'
s.dependency 'JSONModel', '~> 1.1'
s.dependency 'ISO8601', '~> 0.3'
end

View File

@ -8,3 +8,7 @@ from __future__ import absolute_import
{{/apis}}{{/apiInfo}} {{/apis}}{{/apiInfo}}
# import ApiClient # import ApiClient
from .api_client import ApiClient from .api_client import ApiClient
from .configuration import Configuration
configuration = Configuration()

View File

@ -27,19 +27,20 @@ import os
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems from six import iteritems
from .. import configuration from ..configuration import Configuration
from ..api_client import ApiClient from ..api_client import ApiClient
{{#operations}} {{#operations}}
class {{classname}}(object): class {{classname}}(object):
def __init__(self, api_client=None): def __init__(self, api_client=None):
config = Configuration()
if api_client: if api_client:
self.api_client = api_client self.api_client = api_client
else: else:
if not configuration.api_client: if not config.api_client:
configuration.api_client = ApiClient('{{basePath}}') config.api_client = ApiClient('{{basePath}}')
self.api_client = configuration.api_client self.api_client = config.api_client
{{#operation}} {{#operation}}
def {{nickname}}(self, {{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}**kwargs): def {{nickname}}(self, {{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}**kwargs):
@ -47,15 +48,25 @@ class {{classname}}(object):
{{{summary}}} {{{summary}}}
{{{notes}}} {{{notes}}}
{{#allParams}}:param {{dataType}} {{paramName}}: {{{description}}} {{#required}}(required){{/required}}{{^required}}(optional){{/required}} SDK also supports asynchronous requests in which you can define a `callback` function
to be passed along and invoked when receiving response:
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function)
:param callback function: The callback function for asynchronous request. (optional)
{{#allParams}}:param {{dataType}} {{paramName}}: {{{description}}} {{#required}}(required){{/required}}{{#optional}}(optional){{/optional}}
{{/allParams}} {{/allParams}}
:return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} :return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}
If the method is called asynchronously, returns the request thread.
""" """
{{#allParams}}{{#required}}# verify the required parameter '{{paramName}}' is set {{#allParams}}{{#required}}# verify the required parameter '{{paramName}}' is set
if {{paramName}} is None: if {{paramName}} is None:
raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{nickname}}`") raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{nickname}}`")
{{/required}}{{/allParams}} {{/required}}{{/allParams}}
all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}]
all_params.append('callback')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in iteritems(params['kwargs']):
@ -106,17 +117,7 @@ class {{classname}}(object):
response = self.api_client.call_api(resource_path, method, path_params, query_params, header_params, response = self.api_client.call_api(resource_path, method, path_params, query_params, header_params,
body=body_params, post_params=form_params, files=files, body=body_params, post_params=form_params, files=files,
response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, auth_settings=auth_settings) response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, auth_settings=auth_settings, callback=params.get('callback'))
{{#returnType}}
return response return response
{{/returnType}}{{/operation}} {{/operation}}
{{/operations}} {{/operations}}

View File

@ -15,10 +15,13 @@ import os
import re import re
import urllib import urllib
import json import json
import datetime
import mimetypes import mimetypes
import random import random
import tempfile import tempfile
import threading
from datetime import datetime
from datetime import date
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems from six import iteritems
@ -30,7 +33,7 @@ except ImportError:
# for python2 # for python2
from urllib import quote from urllib import quote
from . import configuration from .configuration import Configuration
class ApiClient(object): class ApiClient(object):
""" """
@ -40,7 +43,7 @@ class ApiClient(object):
:param header_name: a header to pass when making calls to the API :param header_name: a header to pass when making calls to the API
:param header_value: a header value to pass when making calls to the API :param header_value: a header value to pass when making calls to the API
""" """
def __init__(self, host=configuration.host, header_name=None, header_value=None): def __init__(self, host=Configuration().host, header_name=None, header_value=None):
self.default_headers = {} self.default_headers = {}
if header_name is not None: if header_name is not None:
self.default_headers[header_name] = header_value self.default_headers[header_name] = header_value
@ -60,8 +63,8 @@ class ApiClient(object):
def set_default_header(self, header_name, header_value): def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value self.default_headers[header_name] = header_value
def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, def __call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None, response_type=None, auth_settings=None): body=None, post_params=None, files=None, response_type=None, auth_settings=None, callback=None):
# headers parameters # headers parameters
header_params = header_params or {} header_params = header_params or {}
@ -106,9 +109,14 @@ class ApiClient(object):
# deserialize response data # deserialize response data
if response_type: if response_type:
return self.deserialize(response_data, response_type) deserialized_data = self.deserialize(response_data, response_type)
else: else:
return None deserialized_data = None
if callback:
callback(deserialized_data)
else:
return deserialized_data
def to_path_value(self, obj): def to_path_value(self, obj):
""" """
@ -140,7 +148,7 @@ class ApiClient(object):
return obj return obj
elif isinstance(obj, list): elif isinstance(obj, list):
return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj]
elif isinstance(obj, (datetime.datetime, datetime.date)): elif isinstance(obj, (datetime, date)):
return obj.isoformat() return obj.isoformat()
else: else:
if isinstance(obj, dict): if isinstance(obj, dict):
@ -197,7 +205,7 @@ class ApiClient(object):
# convert str to class # convert str to class
# for native types # for native types
if klass in ['int', 'float', 'str', 'bool', 'datetime', "object"]: if klass in ['int', 'float', 'str', 'bool', "date", 'datetime', "object"]:
klass = eval(klass) klass = eval(klass)
# for model types # for model types
else: else:
@ -207,12 +215,54 @@ class ApiClient(object):
return self.__deserialize_primitive(data, klass) return self.__deserialize_primitive(data, klass)
elif klass == object: elif klass == object:
return self.__deserialize_object() return self.__deserialize_object()
elif klass == date:
return self.__deserialize_date(data)
elif klass == datetime: elif klass == datetime:
return self.__deserialize_datatime(data) return self.__deserialize_datatime(data)
else: else:
return self.__deserialize_model(data, klass) return self.__deserialize_model(data, klass)
def request(self, method, url, query_params=None, headers=None, post_params=None, body=None): def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, callback=None):
"""
Perform http request and return deserialized data
:param resource_path: Path to method endpoint.
:param method: Method to call.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters, for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
:param response: Response data type.
:param files dict: key -> filename, value -> filepath, for `multipart/form-data`.
:param callback function: Callback function for asynchronous request.
If provide this parameter, the request will be called asynchronously.
:return:
If provide parameter callback, the request will be called asynchronously.
The method will return the request thread.
If parameter callback is None, then the method will return the response directly.
"""
if callback is None:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
response_type, auth_settings, callback)
else:
thread = threading.Thread(target=self.__call_api,
args=(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
response_type, auth_settings, callback))
thread.start()
return thread
def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None):
""" """
Perform http request using RESTClient. Perform http request using RESTClient.
""" """
@ -280,11 +330,13 @@ class ApiClient(object):
""" """
Update header and query params based on authentication setting Update header and query params based on authentication setting
""" """
config = Configuration()
if not auth_settings: if not auth_settings:
return return
for auth in auth_settings: for auth in auth_settings:
auth_setting = configuration.auth_settings().get(auth) auth_setting = config.auth_settings().get(auth)
if auth_setting: if auth_setting:
if auth_setting['in'] == 'header': if auth_setting['in'] == 'header':
headers[auth_setting['key']] = auth_setting['value'] headers[auth_setting['key']] = auth_setting['value']
@ -338,6 +390,21 @@ class ApiClient(object):
""" """
return object() return object()
def __deserialize_date(self, string):
"""
Deserialize string to date
:param string: str
:return: date
"""
try:
from dateutil.parser import parse
return parse(string).date()
except ImportError:
return string
except ValueError:
raise ApiException(status=0, reason="Failed to parse `{0}` into a date object".format(string))
def __deserialize_datatime(self, string): def __deserialize_datatime(self, string):
""" """
Deserialize string to datetime. Deserialize string to datetime.

View File

@ -1,52 +1,121 @@
from __future__ import absolute_import from __future__ import absolute_import
import base64 import base64
import urllib3 import urllib3
import httplib
import sys
import logging
def get_api_key_with_prefix(key): def singleton(cls, *args, **kw):
global api_key instances = {}
global api_key_prefix
if api_key.get(key) and api_key_prefix.get(key): def _singleton():
return api_key_prefix[key] + ' ' + api_key[key] if cls not in instances:
elif api_key.get(key): instances[cls] = cls(*args, **kw)
return api_key[key] return instances[cls]
return _singleton
def get_basic_auth_token():
global username
global password
return urllib3.util.make_headers(basic_auth=username + ':' + password).get('authorization') @singleton
class Configuration(object):
def auth_settings(): def __init__(self):
return { {{#authMethods}}{{#isApiKey}} # Default Base url
'{{name}}': { self.host = "{{basePath}}"
'type': 'api_key', # Default api client
'in': {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, self.api_client = None
'key': '{{keyParamName}}', # Authentication Settings
'value': get_api_key_with_prefix('{{keyParamName}}') self.api_key = {}
}, self.api_key_prefix = {}
{{/isApiKey}}{{#isBasic}} self.username = ""
'{{name}}': { self.password = ""
'type': 'basic', # Logging Settings
'in': 'header', self.logging_format = '%(asctime)s %(levelname)s %(message)s'
'key': 'Authorization', self.__logging_file = None
'value': get_basic_auth_token() self.__debug = False
}, self.init_logger()
{{/isBasic}}{{/authMethods}}
}
# Default Base url def init_logger(self):
host = "{{basePath}}" self.logger = logging.getLogger()
formatter = logging.Formatter(self.logging_format)
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(formatter)
self.logger.addHandler(stream_handler)
if self.__debug:
self.logger.setLevel(logging.DEBUG)
else:
self.logger.setLevel(logging.WARNING)
if self.__logging_file:
file_handler = logging.FileHandler(self.__logging_file)
file_handler.setFormatter(formatter)
self.logger.addFilter(file_handler)
@property
def logging_file(self):
return self.__logging_file
@logging_file.setter
def logging_file(self, value):
self.__logging_file = value
if self.__logging_file:
formater = logging.Formatter(self.logging_format)
file_handler = logging.FileHandler(self.__logging_file)
file_handler.setFormatter(formater)
self.logger.addHandler(file_handler)
@property
def debug(self):
return self.__debug
@debug.setter
def debug(self, value):
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
self.logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
self.logger.setLevel(logging.WARNING)
def get_api_key_with_prefix(self, key):
""" Return api key prepend prefix for key """
if self.api_key.get(key) and self.api_key_prefix.get(key):
return self.api_key_prefix[key] + ' ' + self.api_key[key]
elif self.api_key.get(key):
return self.api_key[key]
def get_basic_auth_token(self):
""" Return basic auth header string """
return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\
.get('authorization')
def auth_settings(self):
""" Return Auth Settings for api client """
return { {{#authMethods}}{{#isApiKey}}
'{{name}}': {
'type': 'api_key',
'in': {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}},
'key': '{{keyParamName}}',
'value': self.get_api_key_with_prefix('{{keyParamName}}')
},
{{/isApiKey}}{{#isBasic}}
'{{name}}': {
'type': 'basic',
'in': 'header',
'key': 'Authorization',
'value': self.get_basic_auth_token()
},
{{/isBasic}}{{/authMethods}}
}
def to_debug_report(self):
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: {{version}}\n"\
"SDK Package Version: {{packageVersion}}".format(env=sys.platform, pyversion=sys.version)
# Default api client
api_client = None
# Authentication settings
api_key = {}
api_key_prefix = {}
username = ''
password = ''
# Temp foloder for file download
temp_folder_path = None

View File

@ -10,6 +10,7 @@ import io
import json import json
import ssl import ssl
import certifi import certifi
import logging
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems from six import iteritems
@ -27,6 +28,9 @@ except ImportError:
from urllib import urlencode from urllib import urlencode
logger = logging.getLogger(__name__)
class RESTResponse(io.IOBase): class RESTResponse(io.IOBase):
def __init__(self, resp): def __init__(self, resp):
@ -65,9 +69,10 @@ class RESTClientObject(object):
def agent(self, url): def agent(self, url):
""" """
Return proper pool manager for the http\https schemes. Use `urllib3.util.parse_url` for backward compatibility.
Return proper pool manager for the http/https schemes.
""" """
url = urllib3.util.url.parse_url(url) url = urllib3.util.parse_url(url)
scheme = url.scheme scheme = url.scheme
if scheme == 'https': if scheme == 'https':
return self.ssl_pool_manager return self.ssl_pool_manager
@ -130,6 +135,9 @@ class RESTClientObject(object):
if sys.version_info > (3,): if sys.version_info > (3,):
r.data = r.data.decode('utf8') r.data = r.data.decode('utf8')
# log response body
logger.debug("response body: %s" % r.data)
if r.status not in range(200, 206): if r.status not in range(200, 206):
raise ApiException(http_resp=r) raise ApiException(http_resp=r)

View File

@ -15,18 +15,18 @@ MyApp.add_route('{{httpMethod}}', '{{path}}', {
{ {
"name" => "{{paramName}}", "name" => "{{paramName}}",
"description" => "{{description}}", "description" => "{{description}}",
"dataType" => "{{swaggerDataType}}", "dataType" => "{{dataType}}",
"paramType" => "query", "paramType" => "query",
"allowMultiple" => {{allowMultiple}}, {{#collectionFormat}}"collectionFormat" => "{{collectionFormat}}",{{/collectionFormat}}
"allowableValues" => "{{allowableValues}}", "allowableValues" => "{{allowableValues}}",
{{#defaultValue}}"defaultValue" => {{{defaultValue}}}{{/defaultValue}} {{#defaultValue}}"defaultValue" => "{{{defaultValue}}}"{{/defaultValue}}
}, },
{{/queryParams}} {{/queryParams}}
{{#pathParams}} {{#pathParams}}
{ {
"name" => "{{paramName}}", "name" => "{{paramName}}",
"description" => "{{description}}", "description" => "{{description}}",
"dataType" => "{{swaggerDataType}}", "dataType" => "{{dataType}}",
"paramType" => "path", "paramType" => "path",
}, },
{{/pathParams}} {{/pathParams}}
@ -34,7 +34,7 @@ MyApp.add_route('{{httpMethod}}', '{{path}}', {
{ {
"name" => "{{paramName}}", "name" => "{{paramName}}",
"description" => "{{description}}", "description" => "{{description}}",
"dataType" => "{{swaggerDataType}}", "dataType" => "{{dataType}}",
"paramType" => "header", "paramType" => "header",
}, },
{{/headerParams}} {{/headerParams}}
@ -42,7 +42,7 @@ MyApp.add_route('{{httpMethod}}', '{{path}}', {
{ {
"name" => "body", "name" => "body",
"description" => "{{description}}", "description" => "{{description}}",
"dataType" => "{{swaggerDataType}}", "dataType" => "{{dataType}}",
"paramType" => "body", "paramType" => "body",
} }
{{/bodyParams}} {{/bodyParams}}

View File

@ -3,10 +3,10 @@ require './lib/swaggering'
# only need to extend if you want special configuration! # only need to extend if you want special configuration!
class MyApp < Swaggering class MyApp < Swaggering
self.configure do |config| self.configure do |config|
config.api_version = '0.2' config.api_version = '{{version}}'
end end
end end
{{#apis}} {{#apis}}
require './lib/{{className}}.rb' require './lib/{{className}}.rb'
{{/apis}} {{/apis}}

View File

@ -1,5 +0,0 @@
platform :ios, '6.0'
xcodeproj 'SwaggerClient/SwaggerClient.xcodeproj'
pod 'AFNetworking', '~> 2.1'
pod 'JSONModel', '~> 1.0'
pod 'ISO8601'

View File

@ -1,36 +0,0 @@
PODS:
- AFNetworking (2.5.4):
- AFNetworking/NSURLConnection (= 2.5.4)
- AFNetworking/NSURLSession (= 2.5.4)
- AFNetworking/Reachability (= 2.5.4)
- AFNetworking/Security (= 2.5.4)
- AFNetworking/Serialization (= 2.5.4)
- AFNetworking/UIKit (= 2.5.4)
- AFNetworking/NSURLConnection (2.5.4):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/NSURLSession (2.5.4):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (2.5.4)
- AFNetworking/Security (2.5.4)
- AFNetworking/Serialization (2.5.4)
- AFNetworking/UIKit (2.5.4):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- ISO8601 (0.3.0)
- JSONModel (1.1.0)
DEPENDENCIES:
- AFNetworking (~> 2.1)
- ISO8601
- JSONModel (~> 1.0)
SPEC CHECKSUMS:
AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e
ISO8601: 8d8a22d5edf0554a1cf75bac028c76c1dc0ffaef
JSONModel: ec77e9865236a7a09d9cf7668df6b4b328d9ec1d
COCOAPODS: 0.37.1

View File

@ -0,0 +1,19 @@
# SwaggerClient
## Requirements
The API client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project.
## Installation
To install it, put the API client library in your project and then simply add the following line to your Podfile:
```ruby
pod "SwaggerClient", :path => "/path/to/lib"
```
## Author
apiteam@swagger.io

View File

@ -0,0 +1,31 @@
#
# Be sure to run `pod lib lint SwaggerClient.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = "SwaggerClient"
s.version = "1.0.0"
s.summary = "Swagger Petstore"
s.description = <<-DESC
This is a sample server Petstore server. You can find out more about Swagger at &lt;a href=\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger. For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters
DESC
s.platform = :ios, '7.0'
s.requires_arc = true
s.framework = 'SystemConfiguration'
s.source_files = 'SwaggerClient/**/*'
s.public_header_files = 'SwaggerClient/**/*.h'
s.dependency 'AFNetworking', '~> 2.3'
s.dependency 'JSONModel', '~> 1.1'
s.dependency 'ISO8601', '~> 0.3'
end

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:SwaggerClient/SwaggerClient.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -1,7 +1,11 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <ISO8601/ISO8601.h> #import <ISO8601/ISO8601.h>
#import "AFHTTPRequestOperationManager.h" #import <AFNetworking/AFHTTPRequestOperationManager.h>
#import "SWGJSONResponseSerializer.h" #import "SWGJSONResponseSerializer.h"
#import "SWGJSONRequestSerializer.h"
#import "SWGQueryParamCollection.h"
#import "SWGConfiguration.h"
#import "SWGUser.h" #import "SWGUser.h"
#import "SWGCategory.h" #import "SWGCategory.h"
@ -22,11 +26,6 @@ extern NSString *const SWGResponseObjectErrorKey;
@property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy; @property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
@property(nonatomic, assign) NSTimeInterval timeoutInterval; @property(nonatomic, assign) NSTimeInterval timeoutInterval;
@property(nonatomic, assign) BOOL logRequests;
@property(nonatomic, assign) BOOL logCacheHits;
@property(nonatomic, assign) BOOL logServerResponses;
@property(nonatomic, assign) BOOL logJSON;
@property(nonatomic, assign) BOOL logHTTP;
@property(nonatomic, readonly) NSOperationQueue* queue; @property(nonatomic, readonly) NSOperationQueue* queue;
/** /**
@ -45,13 +44,6 @@ extern NSString *const SWGResponseObjectErrorKey;
*/ */
+(NSOperationQueue*) sharedQueue; +(NSOperationQueue*) sharedQueue;
/**
* Turn on logging
*
* @param state logging state, must be `YES` or `NO`
*/
+(void)setLoggingEnabled:(bool) state;
/** /**
* Clear Cache * Clear Cache
*/ */
@ -175,6 +167,17 @@ extern NSString *const SWGResponseObjectErrorKey;
*/ */
- (id) deserialize:(id) data class:(NSString *) class; - (id) deserialize:(id) data class:(NSString *) class;
/**
* Logging request and response
*
* @param operation AFHTTPRequestOperation for the HTTP request.
* @param request The HTTP request.
* @param error The error of the HTTP request.
*/
- (void)logResponse:(AFHTTPRequestOperation *)operation
forRequest:(NSURLRequest *)request
error:(NSError *)error;
/** /**
* Perform request * Perform request
* *
@ -193,15 +196,14 @@ extern NSString *const SWGResponseObjectErrorKey;
-(NSNumber*) requestWithCompletionBlock:(NSString*) path -(NSNumber*) requestWithCompletionBlock:(NSString*) path
method:(NSString*) method method:(NSString*) method
queryParams:(NSDictionary*) queryParams queryParams:(NSDictionary*) queryParams
formParams:(NSDictionary *) formParams
files:(NSDictionary *) files
body:(id) body body:(id) body
headerParams:(NSDictionary*) headerParams headerParams:(NSDictionary*) headerParams
authSettings: (NSArray *) authSettings authSettings: (NSArray *) authSettings
requestContentType:(NSString*) requestContentType requestContentType:(NSString*) requestContentType
responseContentType:(NSString*) responseContentType responseContentType:(NSString*) responseContentType
responseType:(NSString *) responseType
completionBlock:(void (^)(id, NSError *))completionBlock; completionBlock:(void (^)(id, NSError *))completionBlock;
@end @end

View File

@ -1,7 +1,4 @@
#import "SWGApiClient.h" #import "SWGApiClient.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h"
#import "SWGConfiguration.h"
@implementation SWGApiClient @implementation SWGApiClient
@ -14,31 +11,38 @@ static bool cacheEnabled = false;
static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable; static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable;
static NSOperationQueue* sharedQueue; static NSOperationQueue* sharedQueue;
static void (^reachabilityChangeBlock)(int); static void (^reachabilityChangeBlock)(int);
static bool loggingEnabled = true;
#pragma mark - Log Methods #pragma mark - Log Methods
+(void)setLoggingEnabled:(bool) state { - (void)logResponse:(AFHTTPRequestOperation *)operation
loggingEnabled = state; forRequest:(NSURLRequest *)request
error:(NSError*)error {
SWGConfiguration *config = [SWGConfiguration sharedConfig];
NSString *message = [NSString stringWithFormat:@"\n[DEBUG] Request body \n~BEGIN~\n %@\n~END~\n"\
"[DEBUG] HTTP Response body \n~BEGIN~\n %@\n~END~\n",
[[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding],
operation.responseString];
if (config.loggingFileHanlder) {
[config.loggingFileHanlder seekToEndOfFile];
[config.loggingFileHanlder writeData:[message dataUsingEncoding:NSUTF8StringEncoding]];
}
NSLog(@"%@", message);
} }
- (void)logRequest:(NSURLRequest*)request { #pragma mark - Cache Methods
NSLog(@"request: %@", [self descriptionForRequest:request]);
}
- (void)logResponse:(id)data forRequest:(NSURLRequest*)request error:(NSError*)error { + (void) setCacheEnabled:(BOOL)enabled {
NSLog(@"request: %@ response: %@ ", [self descriptionForRequest:request], data ); cacheEnabled = enabled;
} }
#pragma mark -
+(void)clearCache { +(void)clearCache {
[[NSURLCache sharedURLCache] removeAllCachedResponses]; [[NSURLCache sharedURLCache] removeAllCachedResponses];
} }
+(void)setCacheEnabled:(BOOL)enabled { #pragma mark -
cacheEnabled = enabled;
}
+(void)configureCacheWithMemoryAndDiskCapacity: (unsigned long) memorySize +(void)configureCacheWithMemoryAndDiskCapacity: (unsigned long) memorySize
diskSize: (unsigned long) diskSize { diskSize: (unsigned long) diskSize {
@ -83,10 +87,10 @@ static bool loggingEnabled = true;
if (client == nil) { if (client == nil) {
client = [[SWGApiClient alloc] initWithBaseURL:[NSURL URLWithString:baseUrl]]; client = [[SWGApiClient alloc] initWithBaseURL:[NSURL URLWithString:baseUrl]];
[_pool setValue:client forKey:baseUrl ]; [_pool setValue:client forKey:baseUrl ];
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"new client for path %@", baseUrl); NSLog(@"new client for path %@", baseUrl);
} }
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"returning client for path %@", baseUrl); NSLog(@"returning client for path %@", baseUrl);
return client; return client;
} }
@ -149,7 +153,7 @@ static bool loggingEnabled = true;
+(NSNumber*) nextRequestId { +(NSNumber*) nextRequestId {
@synchronized(self) { @synchronized(self) {
long nextId = ++requestId; long nextId = ++requestId;
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"got id %ld", nextId); NSLog(@"got id %ld", nextId);
return [NSNumber numberWithLong:nextId]; return [NSNumber numberWithLong:nextId];
} }
@ -157,7 +161,7 @@ static bool loggingEnabled = true;
+(NSNumber*) queueRequest { +(NSNumber*) queueRequest {
NSNumber* requestId = [SWGApiClient nextRequestId]; NSNumber* requestId = [SWGApiClient nextRequestId];
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"added %@ to request queue", requestId); NSLog(@"added %@ to request queue", requestId);
[queuedRequests addObject:requestId]; [queuedRequests addObject:requestId];
return requestId; return requestId;
@ -190,7 +194,7 @@ static bool loggingEnabled = true;
}]; }];
if(matchingItems.count == 1) { if(matchingItems.count == 1) {
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"removing request id %@", requestId); NSLog(@"removing request id %@", requestId);
[queuedRequests removeObject:requestId]; [queuedRequests removeObject:requestId];
return true; return true;
@ -225,25 +229,25 @@ static bool loggingEnabled = true;
reachabilityStatus = status; reachabilityStatus = status;
switch (status) { switch (status) {
case AFNetworkReachabilityStatusUnknown: case AFNetworkReachabilityStatusUnknown:
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusUnknown"); NSLog(@"reachability changed to AFNetworkReachabilityStatusUnknown");
[SWGApiClient setOfflineState:true]; [SWGApiClient setOfflineState:true];
break; break;
case AFNetworkReachabilityStatusNotReachable: case AFNetworkReachabilityStatusNotReachable:
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusNotReachable"); NSLog(@"reachability changed to AFNetworkReachabilityStatusNotReachable");
[SWGApiClient setOfflineState:true]; [SWGApiClient setOfflineState:true];
break; break;
case AFNetworkReachabilityStatusReachableViaWWAN: case AFNetworkReachabilityStatusReachableViaWWAN:
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWWAN"); NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWWAN");
[SWGApiClient setOfflineState:false]; [SWGApiClient setOfflineState:false];
break; break;
case AFNetworkReachabilityStatusReachableViaWiFi: case AFNetworkReachabilityStatusReachableViaWiFi:
if(loggingEnabled) if([[SWGConfiguration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWiFi"); NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWiFi");
[SWGApiClient setOfflineState:false]; [SWGApiClient setOfflineState:false];
break; break;
@ -268,7 +272,6 @@ static bool loggingEnabled = true;
for(NSString * key in [queryParams keyEnumerator]){ for(NSString * key in [queryParams keyEnumerator]){
if(counter == 0) separator = @"?"; if(counter == 0) separator = @"?";
else separator = @"&"; else separator = @"&";
NSString * value;
id queryParam = [queryParams valueForKey:key]; id queryParam = [queryParams valueForKey:key];
if([queryParam isKindOfClass:[NSString class]]){ if([queryParam isKindOfClass:[NSString class]]){
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
@ -314,11 +317,6 @@ static bool loggingEnabled = true;
return requestUrl; return requestUrl;
} }
- (NSString*)descriptionForRequest:(NSURLRequest*)request {
return [[request URL] absoluteString];
}
/** /**
* Update header and query params based on authentication settings * Update header and query params based on authentication settings
*/ */
@ -359,8 +357,8 @@ static bool loggingEnabled = true;
NSMutableArray *resultArray = nil; NSMutableArray *resultArray = nil;
NSMutableDictionary *resultDict = nil; NSMutableDictionary *resultDict = nil;
// return nil if data is nil // return nil if data is nil or class is nil
if (!data) { if (!data || !class) {
return nil; return nil;
} }
@ -473,20 +471,112 @@ static bool loggingEnabled = true;
return nil; return nil;
} }
#pragma mark - Operation Methods
- (void) operationWithCompletionBlock: (NSURLRequest *)request
requestId: (NSNumber *) requestId
completionBlock: (void (^)(id, NSError *))completionBlock {
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id response) {
if([self executeRequestWithId:requestId]) {
if([[SWGConfiguration sharedConfig] debug]) {
[self logResponse:operation forRequest:request error:nil];
}
completionBlock(response, nil);
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if(operation.responseObject) {
// Add in the (parsed) response body.
userInfo[SWGResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if([[SWGConfiguration sharedConfig] debug])
[self logResponse:nil forRequest:request error:augmentedError];
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
}
- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request
requestId: (NSNumber *) requestId
completionBlock: (void (^)(id, NSError *))completionBlock {
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id responseObject) {
SWGConfiguration *config = [SWGConfiguration sharedConfig];
NSString *directory = nil;
if (config.tempFolderPath) {
directory = config.tempFolderPath;
}
else {
directory = NSTemporaryDirectory();
}
NSDictionary *headers = operation.response.allHeaderFields;
NSString *filename = nil;
if ([headers objectForKey:@"Content-Disposition"]) {
NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?";
NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern
options:NSRegularExpressionCaseInsensitive
error:nil];
NSString *contentDispositionHeader = [headers objectForKey:@"Content-Disposition"];
NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader
options:0
range:NSMakeRange(0, [contentDispositionHeader length])];
filename = [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]];
}
else {
filename = [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]];
}
NSString *filepath = [directory stringByAppendingPathComponent:filename];
NSURL *file = [NSURL fileURLWithPath:filepath];
[operation.responseData writeToURL:file atomically:YES];
completionBlock(file, nil);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if ([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if (operation.responseObject) {
userInfo[SWGResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if ([[SWGConfiguration sharedConfig] debug]) {
[self logResponse:nil forRequest:request error:augmentedError];
}
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
}
#pragma mark - Perform Request Methods #pragma mark - Perform Request Methods
-(NSNumber*) requestWithCompletionBlock: (NSString*) path -(NSNumber*) requestWithCompletionBlock: (NSString*) path
method: (NSString*) method method: (NSString*) method
queryParams: (NSDictionary*) queryParams queryParams: (NSDictionary*) queryParams
formParams: (NSDictionary *) formParams
files: (NSDictionary *) files
body: (id) body body: (id) body
headerParams: (NSDictionary*) headerParams headerParams: (NSDictionary*) headerParams
authSettings: (NSArray *) authSettings authSettings: (NSArray *) authSettings
requestContentType: (NSString*) requestContentType requestContentType: (NSString*) requestContentType
responseContentType: (NSString*) responseContentType responseContentType: (NSString*) responseContentType
responseType: (NSString *) responseType
completionBlock: (void (^)(id, NSError *))completionBlock { completionBlock: (void (^)(id, NSError *))completionBlock {
// setting request serializer // setting request serializer
if ([requestContentType isEqualToString:@"application/json"]) { if ([requestContentType isEqualToString:@"application/json"]) {
self.requestSerializer = [AFJSONRequestSerializer serializer]; self.requestSerializer = [SWGJSONRequestSerializer serializer];
} }
else if ([requestContentType isEqualToString:@"application/x-www-form-urlencoded"]) { else if ([requestContentType isEqualToString:@"application/x-www-form-urlencoded"]) {
self.requestSerializer = [AFHTTPRequestSerializer serializer]; self.requestSerializer = [AFHTTPRequestSerializer serializer];
@ -510,68 +600,42 @@ static bool loggingEnabled = true;
[self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings];
NSMutableURLRequest * request = nil; NSMutableURLRequest * request = nil;
if (body != nil && [body isKindOfClass:[NSArray class]]){ NSString* pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
SWGFile * file; NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
NSMutableDictionary * params = [[NSMutableDictionary alloc] init]; if (files.count > 0) {
for(id obj in body) { request = [self.requestSerializer multipartFormRequestWithMethod:@"POST"
if([obj isKindOfClass:[SWGFile class]]) { URLString:urlString
file = (SWGFile*) obj; parameters:nil
requestContentType = @"multipart/form-data"; constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
} [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
else if([obj isKindOfClass:[NSDictionary class]]) { NSData *data = [obj dataUsingEncoding:NSUTF8StringEncoding];
for(NSString * key in obj) { [formData appendPartWithFormData:data name:key];
params[key] = obj[key]; }];
} [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
} NSURL *filePath = (NSURL *)obj;
} [formData appendPartWithFileURL:filePath name:key error:nil];
NSString * urlString = [[NSURL URLWithString:path relativeToURL:self.baseURL] absoluteString]; }];
} error:nil];
// request with multipart form
if([requestContentType isEqualToString:@"multipart/form-data"]) {
request = [self.requestSerializer multipartFormRequestWithMethod: @"POST"
URLString: urlString
parameters: nil
constructingBodyWithBlock: ^(id<AFMultipartFormData> formData) {
for(NSString * key in params) {
NSData* data = [params[key] dataUsingEncoding:NSUTF8StringEncoding];
[formData appendPartWithFormData: data name: key];
}
if (file) {
[formData appendPartWithFileData: [file data]
name: [file paramName]
fileName: [file name]
mimeType: [file mimeType]];
}
}
error:nil];
}
// request with form parameters or json
else {
NSString* pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:params
error:nil];
}
} }
else { else {
NSString * pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams]; if (formParams) {
NSString * urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; request = [self.requestSerializer requestWithMethod:method
URLString:urlString
request = [self.requestSerializer requestWithMethod: method parameters:formParams
URLString: urlString error:nil];
parameters: body }
error: nil]; if (body) {
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:body
error:nil];
}
} }
BOOL hasHeaderParams = false; BOOL hasHeaderParams = false;
if(headerParams != nil && [headerParams count] > 0) if(headerParams != nil && [headerParams count] > 0) {
hasHeaderParams = true; hasHeaderParams = true;
}
if(offlineState) { if(offlineState) {
NSLog(@"%@ cache forced", path); NSLog(@"%@ cache forced", path);
[request setCachePolicy:NSURLRequestReturnCacheDataDontLoad]; [request setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
@ -585,17 +649,7 @@ static bool loggingEnabled = true;
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
} }
if(hasHeaderParams){
if(body != nil) {
if([body isKindOfClass:[NSDictionary class]] || [body isKindOfClass:[NSArray class]]){
[self.requestSerializer setValue:requestContentType forHTTPHeaderField:@"Content-Type"];
}
else if ([body isKindOfClass:[SWGFile class]]){}
else {
NSAssert(false, @"unsupported post type!");
}
}
if(headerParams != nil){
for(NSString * key in [headerParams keyEnumerator]){ for(NSString * key in [headerParams keyEnumerator]){
[request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key];
} }
@ -607,30 +661,16 @@ static bool loggingEnabled = true;
[request setHTTPShouldHandleCookies:NO]; [request setHTTPShouldHandleCookies:NO];
NSNumber* requestId = [SWGApiClient queueRequest]; NSNumber* requestId = [SWGApiClient queueRequest];
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request if ([responseType isEqualToString:@"NSURL*"]) {
success:^(AFHTTPRequestOperation *operation, id response) { [self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) {
if([self executeRequestWithId:requestId]) { completionBlock(data, error);
if(self.logServerResponses) { }];
[self logResponse:response forRequest:request error:nil]; }
} else {
completionBlock(response, nil); [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) {
} completionBlock([self deserialize:data class:responseType], error);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { }];
if([self executeRequestWithId:requestId]) { }
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if(operation.responseObject) {
// Add in the (parsed) response body.
userInfo[SWGResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if(self.logServerResponses)
[self logResponse:nil forRequest:request error:augmentedError];
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
return requestId; return requestId;
} }
@ -639,8 +679,3 @@ static bool loggingEnabled = true;

View File

@ -23,6 +23,18 @@
@property (nonatomic) NSString *username; @property (nonatomic) NSString *username;
@property (nonatomic) NSString *password; @property (nonatomic) NSString *password;
/**
* Temp folder for file download
*/
@property (nonatomic) NSString *tempFolderPath;
/**
* Logging Settings
*/
@property (nonatomic) BOOL debug;
@property (nonatomic) NSString *loggingFile;
@property (nonatomic) NSFileHandle *loggingFileHanlder;
/** /**
* Get configuration singleton instance * Get configuration singleton instance
*/ */

View File

@ -27,6 +27,9 @@
if (self) { if (self) {
self.username = @""; self.username = @"";
self.password = @""; self.password = @"";
self.tempFolderPath = nil;
self.debug = NO;
self.loggingFile = nil;
self.mutableApiKey = [NSMutableDictionary dictionary]; self.mutableApiKey = [NSMutableDictionary dictionary];
self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; self.mutableApiKeyPrefix = [NSMutableDictionary dictionary];
} }
@ -65,6 +68,20 @@
[self.mutableApiKeyPrefix setValue:value forKey:field]; [self.mutableApiKeyPrefix setValue:value forKey:field];
} }
- (void) setLoggingFile:(NSString *)loggingFile {
// close old file handler
if ([self.loggingFileHanlder isKindOfClass:[NSFileHandle class]]) {
[self.loggingFileHanlder closeFile];
}
_loggingFile = loggingFile;
self.loggingFileHanlder = [NSFileHandle fileHandleForWritingAtPath:_loggingFile];
if (self.loggingFileHanlder == nil) {
[[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil];
self.loggingFileHanlder = [NSFileHandle fileHandleForWritingAtPath:_loggingFile];
}
}
#pragma mark - Getter Methods #pragma mark - Getter Methods
- (NSDictionary *) apiKey { - (NSDictionary *) apiKey {

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
#import <AFNetworking/AFURLRequestSerialization.h>
@interface SWGJSONRequestSerializer : AFJSONRequestSerializer
@end

View File

@ -0,0 +1,35 @@
#import "SWGJSONRequestSerializer.h"
@implementation SWGJSONRequestSerializer
///
/// When customize a request serializer,
/// the serializer must conform the protocol `AFURLRequestSerialization`
/// and implements the protocol method `requestBySerializingRequest:withParameters:error:`
///
/// @param request The original request.
/// @param parameters The parameters to be encoded.
/// @param error The error that occurred while attempting to encode the request parameters.
///
/// @return A serialized request.
///
- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
withParameters:(id)parameters
error:(NSError *__autoreleasing *)error
{
// If the body data which will be serialized isn't NSArray or NSDictionary
// then put the data in the http request body directly.
if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) {
return [super requestBySerializingRequest:request withParameters:parameters error:error];
} else {
NSMutableURLRequest *mutableRequest = [request mutableCopy];
if (parameters) {
[mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]];
}
return mutableRequest;
}
}
@end

View File

@ -1,5 +1,5 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "JSONModel.h" #import <JSONModel/JSONModel.h>
@interface SWGObject : JSONModel @interface SWGObject : JSONModel
@end @end

View File

@ -19,6 +19,6 @@
*/ */
@property(nonatomic) NSString* status; @property(nonatomic) NSString* status;
@property(nonatomic) BOOL complete; @property(nonatomic) NSNumber* complete;
@end @end

View File

@ -1,6 +1,5 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "SWGPet.h" #import "SWGPet.h"
#import "SWGFile.h"
#import "SWGObject.h" #import "SWGObject.h"
#import "SWGApiClient.h" #import "SWGApiClient.h"
@ -114,13 +113,13 @@
/// Deletes a pet /// Deletes a pet
/// ///
/// ///
/// @param apiKey
/// @param petId Pet id to delete /// @param petId Pet id to delete
/// @param apiKey
/// ///
/// ///
/// @return /// @return
-(NSNumber*) deletePetWithCompletionBlock :(NSString*) apiKey -(NSNumber*) deletePetWithCompletionBlock :(NSNumber*) petId
petId:(NSNumber*) petId apiKey:(NSString*) apiKey
completionHandler: (void (^)(NSError* error))completionBlock; completionHandler: (void (^)(NSError* error))completionBlock;
@ -139,7 +138,7 @@
/// @return /// @return
-(NSNumber*) uploadFileWithCompletionBlock :(NSNumber*) petId -(NSNumber*) uploadFileWithCompletionBlock :(NSNumber*) petId
additionalMetadata:(NSString*) additionalMetadata additionalMetadata:(NSString*) additionalMetadata
file:(SWGFile*) file file:(NSURL*) file
completionHandler: (void (^)(NSError* error))completionBlock; completionHandler: (void (^)(NSError* error))completionBlock;

View File

@ -1,8 +1,6 @@
#import "SWGPetApi.h" #import "SWGPetApi.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h" #import "SWGQueryParamCollection.h"
#import "SWGPet.h" #import "SWGPet.h"
#import "SWGFile.h"
@interface SWGPetApi () @interface SWGPetApi ()
@ -83,7 +81,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) updatePetWithCompletionBlock: (SWGPet*) body -(NSNumber*) updatePetWithCompletionBlock: (SWGPet*) body
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
@ -100,8 +98,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -121,14 +119,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"petstore_auth"]; NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){ id bodyParam = nil;
NSMutableArray * objs = [[NSMutableArray alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
for (id dict in (NSArray*)__body) { NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) { if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]]; [objs addObject:[(SWGObject*)dict toDictionary]];
} }
@ -136,33 +136,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict]; [objs addObject:dict];
} }
} }
bodyDictionary = objs; bodyParam = objs;
} }
else if([__body respondsToSelector:@selector(toDictionary)]) { else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary]; bodyParam = [(SWGObject*)bodyParam toDictionary];
} }
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"PUT" method: @"PUT"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -180,7 +172,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) addPetWithCompletionBlock: (SWGPet*) body -(NSNumber*) addPetWithCompletionBlock: (SWGPet*) body
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
@ -197,8 +189,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -218,14 +210,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"petstore_auth"]; NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){ id bodyParam = nil;
NSMutableArray * objs = [[NSMutableArray alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
for (id dict in (NSArray*)__body) { NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) { if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]]; [objs addObject:[(SWGObject*)dict toDictionary]];
} }
@ -233,33 +227,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict]; [objs addObject:dict];
} }
} }
bodyDictionary = objs; bodyParam = objs;
} }
else if([__body respondsToSelector:@selector(toDictionary)]) { else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary]; bodyParam = [(SWGObject*)bodyParam toDictionary];
} }
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST" method: @"POST"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -276,8 +262,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
-(NSNumber*) findPetsByStatusWithCompletionBlock: (NSArray*) status -(NSNumber*) findPetsByStatusWithCompletionBlock: (NSArray*) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock {
{
@ -300,8 +286,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -321,13 +307,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"petstore_auth"]; NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -335,14 +319,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET" method: @"GET"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: @"NSArray<SWGPet>*"
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"NSArray<SWGPet>*"], error); completionBlock((NSArray<SWGPet>*)data, error);
} }
]; ];
} }
@ -356,8 +343,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
-(NSNumber*) findPetsByTagsWithCompletionBlock: (NSArray*) tags -(NSNumber*) findPetsByTagsWithCompletionBlock: (NSArray*) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock {
{
@ -380,8 +367,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -401,13 +388,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"petstore_auth"]; NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -415,14 +400,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET" method: @"GET"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: @"NSArray<SWGPet>*"
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"NSArray<SWGPet>*"], error); completionBlock((NSArray<SWGPet>*)data, error);
} }
]; ];
} }
@ -436,12 +424,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
-(NSNumber*) getPetByIdWithCompletionBlock: (NSNumber*) petId -(NSNumber*) getPetByIdWithCompletionBlock: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock {
{
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
NSAssert(petId != nil, @"Missing the required parameter `petId` when calling getPetById"); if (petId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `getPetById`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath];
@ -458,8 +448,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -479,13 +469,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"api_key", @"petstore_auth"]; NSArray *authSettings = @[@"api_key", @"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -493,14 +481,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET" method: @"GET"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: @"SWGPet*"
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"SWGPet*"], error); completionBlock((SWGPet*)data, error);
} }
]; ];
} }
@ -521,11 +512,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
status: (NSString*) status status: (NSString*) status
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
NSAssert(petId != nil, @"Missing the required parameter `petId` when calling updatePetWithForm"); if (petId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `updatePetWithForm`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath];
@ -542,8 +535,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -563,29 +556,19 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"petstore_auth"]; NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
formParams[@"name"] = name; formParams[@"name"] = name;
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
formParams[@"status"] = status; formParams[@"status"] = status;
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
@ -593,11 +576,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST" method: @"POST"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -608,21 +594,23 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
/// Deletes a pet /// Deletes a pet
/// ///
/// @param apiKey
///
/// @param petId Pet id to delete /// @param petId Pet id to delete
/// ///
/// @param apiKey
///
/// @returns void /// @returns void
/// ///
-(NSNumber*) deletePetWithCompletionBlock: (NSString*) apiKey -(NSNumber*) deletePetWithCompletionBlock: (NSNumber*) petId
petId: (NSNumber*) petId apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
NSAssert(petId != nil, @"Missing the required parameter `petId` when calling deletePet"); if (petId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `deletePet`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath];
@ -641,8 +629,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
if(apiKey != nil) if(apiKey != nil)
headerParams[@"api_key"] = apiKey; headerParams[@"api_key"] = apiKey;
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -662,13 +650,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"petstore_auth"]; NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -676,11 +662,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"DELETE" method: @"DELETE"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -701,14 +690,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
-(NSNumber*) uploadFileWithCompletionBlock: (NSNumber*) petId -(NSNumber*) uploadFileWithCompletionBlock: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata additionalMetadata: (NSString*) additionalMetadata
file: (SWGFile*) file file: (NSURL*) file
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
NSAssert(petId != nil, @"Missing the required parameter `petId` when calling uploadFile"); if (petId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `uploadFile`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}/uploadImage", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}/uploadImage", basePath];
@ -725,8 +716,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -746,36 +737,19 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"petstore_auth"]; NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
formParams[@"additionalMetadata"] = additionalMetadata; formParams[@"additionalMetadata"] = additionalMetadata;
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
requestContentType = @"multipart/form-data"; files[@"file"] = file;
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
if(file != nil) {
[bodyDictionary addObject:file];
file.paramName = @"file";
}
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
@ -783,11 +757,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST" method: @"POST"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -798,6 +775,3 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
@end @end

View File

@ -1,5 +1,4 @@
#import "SWGStoreApi.h" #import "SWGStoreApi.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h" #import "SWGQueryParamCollection.h"
#import "SWGOrder.h" #import "SWGOrder.h"
@ -78,8 +77,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// @returns NSDictionary* /* NSString, NSNumber */ /// @returns NSDictionary* /* NSString, NSNumber */
/// ///
-(NSNumber*) getInventoryWithCompletionBlock: -(NSNumber*) getInventoryWithCompletionBlock:
(void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error))completionBlock (void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error))completionBlock {
{
@ -96,8 +95,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -117,13 +116,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"api_key"]; NSArray *authSettings = @[@"api_key"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -131,14 +128,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET" method: @"GET"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: @"NSDictionary* /* NSString, NSNumber */"
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"NSDictionary* /* NSString, NSNumber */"], error); completionBlock((NSDictionary* /* NSString, NSNumber */)data, error);
} }
]; ];
} }
@ -152,8 +152,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
-(NSNumber*) placeOrderWithCompletionBlock: (SWGOrder*) body -(NSNumber*) placeOrderWithCompletionBlock: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock {
{
@ -170,8 +170,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -191,14 +191,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){ id bodyParam = nil;
NSMutableArray * objs = [[NSMutableArray alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
for (id dict in (NSArray*)__body) { NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) { if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]]; [objs addObject:[(SWGObject*)dict toDictionary]];
} }
@ -206,36 +208,28 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict]; [objs addObject:dict];
} }
} }
bodyDictionary = objs; bodyParam = objs;
} }
else if([__body respondsToSelector:@selector(toDictionary)]) { else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary]; bodyParam = [(SWGObject*)bodyParam toDictionary];
} }
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST" method: @"POST"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: @"SWGOrder*"
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"SWGOrder*"], error); completionBlock((SWGOrder*)data, error);
} }
]; ];
} }
@ -249,12 +243,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
-(NSNumber*) getOrderByIdWithCompletionBlock: (NSString*) orderId -(NSNumber*) getOrderByIdWithCompletionBlock: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock {
{
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
NSAssert(orderId != nil, @"Missing the required parameter `orderId` when calling getOrderById"); if (orderId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `orderId` when calling `getOrderById`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath];
@ -271,8 +267,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -292,13 +288,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -306,14 +300,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET" method: @"GET"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: @"SWGOrder*"
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"SWGOrder*"], error); completionBlock((SWGOrder*)data, error);
} }
]; ];
} }
@ -328,11 +325,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) deleteOrderWithCompletionBlock: (NSString*) orderId -(NSNumber*) deleteOrderWithCompletionBlock: (NSString*) orderId
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
NSAssert(orderId != nil, @"Missing the required parameter `orderId` when calling deleteOrder"); if (orderId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `orderId` when calling `deleteOrder`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath];
@ -349,8 +348,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -370,13 +369,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -384,11 +381,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"DELETE" method: @"DELETE"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -399,6 +399,3 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
@end @end

View File

@ -1,5 +1,4 @@
#import "SWGUserApi.h" #import "SWGUserApi.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h" #import "SWGQueryParamCollection.h"
#import "SWGUser.h" #import "SWGUser.h"
@ -82,7 +81,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) createUserWithCompletionBlock: (SWGUser*) body -(NSNumber*) createUserWithCompletionBlock: (SWGUser*) body
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
@ -99,8 +98,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -120,14 +119,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){ id bodyParam = nil;
NSMutableArray * objs = [[NSMutableArray alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
for (id dict in (NSArray*)__body) { NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) { if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]]; [objs addObject:[(SWGObject*)dict toDictionary]];
} }
@ -135,33 +136,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict]; [objs addObject:dict];
} }
} }
bodyDictionary = objs; bodyParam = objs;
} }
else if([__body respondsToSelector:@selector(toDictionary)]) { else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary]; bodyParam = [(SWGObject*)bodyParam toDictionary];
} }
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST" method: @"POST"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -179,7 +172,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) createUsersWithArrayInputWithCompletionBlock: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithArrayInputWithCompletionBlock: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
@ -196,8 +189,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -217,14 +210,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){ id bodyParam = nil;
NSMutableArray * objs = [[NSMutableArray alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
for (id dict in (NSArray*)__body) { NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) { if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]]; [objs addObject:[(SWGObject*)dict toDictionary]];
} }
@ -232,33 +227,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict]; [objs addObject:dict];
} }
} }
bodyDictionary = objs; bodyParam = objs;
} }
else if([__body respondsToSelector:@selector(toDictionary)]) { else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary]; bodyParam = [(SWGObject*)bodyParam toDictionary];
} }
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST" method: @"POST"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -276,7 +263,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) createUsersWithListInputWithCompletionBlock: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithListInputWithCompletionBlock: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
@ -293,8 +280,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -314,14 +301,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){ id bodyParam = nil;
NSMutableArray * objs = [[NSMutableArray alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
for (id dict in (NSArray*)__body) { NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) { if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]]; [objs addObject:[(SWGObject*)dict toDictionary]];
} }
@ -329,33 +318,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict]; [objs addObject:dict];
} }
} }
bodyDictionary = objs; bodyParam = objs;
} }
else if([__body respondsToSelector:@selector(toDictionary)]) { else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary]; bodyParam = [(SWGObject*)bodyParam toDictionary];
} }
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST" method: @"POST"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -375,8 +356,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) loginUserWithCompletionBlock: (NSString*) username -(NSNumber*) loginUserWithCompletionBlock: (NSString*) username
password: (NSString*) password password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock completionHandler: (void (^)(NSString* output, NSError* error))completionBlock {
{
@ -401,8 +382,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -422,13 +403,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -436,14 +415,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET" method: @"GET"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: @"NSString*"
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"NSString*"], error); completionBlock((NSString*)data, error);
} }
]; ];
} }
@ -455,7 +437,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
-(NSNumber*) logoutUserWithCompletionBlock: -(NSNumber*) logoutUserWithCompletionBlock:
(void (^)(NSError* error))completionBlock { (void (^)(NSError* error))completionBlock {
@ -472,8 +454,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -493,13 +475,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -507,11 +487,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET" method: @"GET"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -528,12 +511,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// ///
-(NSNumber*) getUserByNameWithCompletionBlock: (NSString*) username -(NSNumber*) getUserByNameWithCompletionBlock: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock {
{
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
NSAssert(username != nil, @"Missing the required parameter `username` when calling getUserByName"); if (username == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `getUserByName`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath];
@ -550,8 +535,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -571,13 +556,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -585,14 +568,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET" method: @"GET"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: @"SWGUser*"
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"SWGUser*"], error); completionBlock((SWGUser*)data, error);
} }
]; ];
} }
@ -610,11 +596,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
body: (SWGUser*) body body: (SWGUser*) body
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
NSAssert(username != nil, @"Missing the required parameter `username` when calling updateUser"); if (username == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `updateUser`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath];
@ -631,8 +619,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -652,14 +640,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){ id bodyParam = nil;
NSMutableArray * objs = [[NSMutableArray alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
for (id dict in (NSArray*)__body) { NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) { if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]]; [objs addObject:[(SWGObject*)dict toDictionary]];
} }
@ -667,33 +657,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict]; [objs addObject:dict];
} }
} }
bodyDictionary = objs; bodyParam = objs;
} }
else if([__body respondsToSelector:@selector(toDictionary)]) { else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary]; bodyParam = [(SWGObject*)bodyParam toDictionary];
} }
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"PUT" method: @"PUT"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -711,11 +693,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) deleteUserWithCompletionBlock: (NSString*) username -(NSNumber*) deleteUserWithCompletionBlock: (NSString*) username
completionHandler: (void (^)(NSError* error))completionBlock { completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
NSAssert(username != nil, @"Missing the required parameter `username` when calling deleteUser"); if (username == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `deleteUser`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath];
@ -732,8 +716,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept` // HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) { if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"]; [headerParams removeObjectForKey:@"Accept"];
@ -753,13 +737,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting // Authentication setting
NSArray *authSettings = @[]; NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -767,11 +749,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"DELETE" method: @"DELETE"
queryParams: queryParams queryParams: queryParams
body: bodyDictionary formParams: formParams
files: files
body: bodyParam
headerParams: headerParams headerParams: headerParams
authSettings: authSettings authSettings: authSettings
requestContentType: requestContentType requestContentType: requestContentType
responseContentType: responseContentType responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) { completionBlock: ^(id data, NSError *error) {
completionBlock(error); completionBlock(error);
@ -782,6 +767,3 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
@end @end

View File

@ -1,688 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
BA525648922D4C0E9F44D4F1 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73DA4F1067C343C3962F1542 /* libPods.a */; };
CF0560EB1B1855CF00C0D4EC /* SWGConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = CF0560EA1B1855CF00C0D4EC /* SWGConfiguration.m */; };
CF31D0991B105E4B00509935 /* SWGApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF31D0981B105E4B00509935 /* SWGApiClientTest.m */; };
CF5B6E2D1B2BD70800862A1C /* UserApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF5B6E2C1B2BD70800862A1C /* UserApiTest.m */; };
CFB37D061B2B11DD00D2E5F1 /* StoreApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB37D051B2B11DC00D2E5F1 /* StoreApiTest.m */; };
CFCEFE511B2C1330006313BE /* SWGJSONResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = CFCEFE501B2C1330006313BE /* SWGJSONResponseSerializer.m */; };
CFD1B6701B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */; };
CFD1B6711B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */; };
EA66999A1811D2FA00A70D03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699991811D2FA00A70D03 /* Foundation.framework */; };
EA66999C1811D2FA00A70D03 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */; };
EA66999E1811D2FA00A70D03 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999D1811D2FA00A70D03 /* UIKit.framework */; };
EA6699A41811D2FA00A70D03 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA6699A21811D2FA00A70D03 /* InfoPlist.strings */; };
EA6699A61811D2FA00A70D03 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699A51811D2FA00A70D03 /* main.m */; };
EA6699AA1811D2FA00A70D03 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699A91811D2FA00A70D03 /* AppDelegate.m */; };
EA6699AD1811D2FA00A70D03 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */; };
EA6699B01811D2FA00A70D03 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */; };
EA6699B31811D2FA00A70D03 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699B21811D2FA00A70D03 /* ViewController.m */; };
EA6699B51811D2FA00A70D03 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EA6699B41811D2FA00A70D03 /* Images.xcassets */; };
EA6699BD1811D2FB00A70D03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699991811D2FA00A70D03 /* Foundation.framework */; };
EA6699BE1811D2FB00A70D03 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999D1811D2FA00A70D03 /* UIKit.framework */; };
EA6699C61811D2FB00A70D03 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA6699C41811D2FB00A70D03 /* InfoPlist.strings */; };
EA8B8AA41AC6683700638FBB /* SWGQueryParamCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = EA8B8AA31AC6683700638FBB /* SWGQueryParamCollection.m */; };
EA8CD3ED1AC2763600C47D0B /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA8CD3EC1AC2763600C47D0B /* SenTestingKit.framework */; };
EAB26B091AC8DE24002F5C7A /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EAB26B081AC8DE24002F5C7A /* libPods.a */; };
EAB26B0C1AC8DF78002F5C7A /* PetApiTest.h in Sources */ = {isa = PBXBuildFile; fileRef = EA8CD3EB1AC274BE00C47D0B /* PetApiTest.h */; };
EAB26B0D1AC8DF78002F5C7A /* PetApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699C71811D2FB00A70D03 /* PetApiTest.m */; };
EAEA85E41811D3AE00F06E69 /* SWGApiClient.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */; };
EAEA85E51811D3AE00F06E69 /* SWGCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */; };
EAEA85E71811D3AE00F06E69 /* SWGFile.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D31811D3AE00F06E69 /* SWGFile.m */; };
EAEA85E81811D3AE00F06E69 /* SWGObject.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D51811D3AE00F06E69 /* SWGObject.m */; };
EAEA85E91811D3AE00F06E69 /* SWGOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D71811D3AE00F06E69 /* SWGOrder.m */; };
EAEA85EA1811D3AE00F06E69 /* SWGPet.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D91811D3AE00F06E69 /* SWGPet.m */; };
EAEA85EB1811D3AE00F06E69 /* SWGPetApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */; };
EAEA85EC1811D3AE00F06E69 /* SWGStoreApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */; };
EAEA85ED1811D3AE00F06E69 /* SWGTag.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DF1811D3AE00F06E69 /* SWGTag.m */; };
EAEA85EE1811D3AE00F06E69 /* SWGUser.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85E11811D3AE00F06E69 /* SWGUser.m */; };
EAEA85EF1811D3AE00F06E69 /* SWGUserApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */; };
EAFBEABB1A925B8500A27431 /* test-1.png in Resources */ = {isa = PBXBuildFile; fileRef = EAFBEABA1A925B8500A27431 /* test-1.png */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
EA6699BF1811D2FB00A70D03 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EA66998E1811D2FA00A70D03 /* Project object */;
proxyType = 1;
remoteGlobalIDString = EA6699951811D2FA00A70D03;
remoteInfo = PetstoreClient;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
73DA4F1067C343C3962F1542 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
A425648B5C0A4849C7668069 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "../Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
CF0560E91B1855CF00C0D4EC /* SWGConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGConfiguration.h; sourceTree = "<group>"; };
CF0560EA1B1855CF00C0D4EC /* SWGConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGConfiguration.m; sourceTree = "<group>"; };
CF31D0981B105E4B00509935 /* SWGApiClientTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClientTest.m; sourceTree = "<group>"; };
CF5B6E2C1B2BD70800862A1C /* UserApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserApiTest.m; sourceTree = "<group>"; };
CFB37D051B2B11DC00D2E5F1 /* StoreApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreApiTest.m; sourceTree = "<group>"; };
CFCEFE4F1B2C1330006313BE /* SWGJSONResponseSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGJSONResponseSerializer.h; sourceTree = "<group>"; };
CFCEFE501B2C1330006313BE /* SWGJSONResponseSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGJSONResponseSerializer.m; sourceTree = "<group>"; };
CFD1B66E1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JSONValueTransformer+ISO8601.h"; sourceTree = "<group>"; };
CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "JSONValueTransformer+ISO8601.m"; sourceTree = "<group>"; };
E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "../Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
EA6699961811D2FA00A70D03 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; };
EA6699991811D2FA00A70D03 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
EA66999D1811D2FA00A70D03 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
EA6699A11811D2FA00A70D03 /* SwaggerClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClient-Info.plist"; sourceTree = "<group>"; };
EA6699A31811D2FA00A70D03 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
EA6699A51811D2FA00A70D03 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
EA6699A71811D2FA00A70D03 /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = "<group>"; };
EA6699A81811D2FA00A70D03 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
EA6699A91811D2FA00A70D03 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
EA6699AC1811D2FA00A70D03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = "<group>"; };
EA6699AF1811D2FA00A70D03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = "<group>"; };
EA6699B11811D2FA00A70D03 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
EA6699B21811D2FA00A70D03 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
EA6699B41811D2FA00A70D03 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
EA6699BA1811D2FB00A70D03 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
EA6699C31811D2FB00A70D03 /* SwaggerClientTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClientTests-Info.plist"; sourceTree = "<group>"; };
EA6699C51811D2FB00A70D03 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
EA6699C71811D2FB00A70D03 /* PetApiTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PetApiTest.m; sourceTree = "<group>"; };
EA8B8AA21AC6683700638FBB /* SWGQueryParamCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGQueryParamCollection.h; sourceTree = "<group>"; };
EA8B8AA31AC6683700638FBB /* SWGQueryParamCollection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGQueryParamCollection.m; sourceTree = "<group>"; };
EA8CD3EB1AC274BE00C47D0B /* PetApiTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PetApiTest.h; sourceTree = "<group>"; };
EA8CD3EC1AC2763600C47D0B /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
EAB26B081AC8DE24002F5C7A /* libPods.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPods.a; path = "/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos/libPods.a"; sourceTree = "<absolute>"; };
EAB26B0E1AC8E692002F5C7A /* SWGPet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGPet.h; sourceTree = "<group>"; };
EAEA85CC1811D3AE00F06E69 /* SWGApiClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGApiClient.h; sourceTree = "<group>"; };
EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClient.m; sourceTree = "<group>"; };
EAEA85CE1811D3AE00F06E69 /* SWGCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGCategory.h; sourceTree = "<group>"; };
EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGCategory.m; sourceTree = "<group>"; };
EAEA85D21811D3AE00F06E69 /* SWGFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGFile.h; sourceTree = "<group>"; };
EAEA85D31811D3AE00F06E69 /* SWGFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGFile.m; sourceTree = "<group>"; };
EAEA85D41811D3AE00F06E69 /* SWGObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGObject.h; sourceTree = "<group>"; };
EAEA85D51811D3AE00F06E69 /* SWGObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGObject.m; sourceTree = "<group>"; };
EAEA85D61811D3AE00F06E69 /* SWGOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGOrder.h; sourceTree = "<group>"; };
EAEA85D71811D3AE00F06E69 /* SWGOrder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGOrder.m; sourceTree = "<group>"; };
EAEA85D91811D3AE00F06E69 /* SWGPet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGPet.m; sourceTree = "<group>"; };
EAEA85DA1811D3AE00F06E69 /* SWGPetApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGPetApi.h; sourceTree = "<group>"; };
EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGPetApi.m; sourceTree = "<group>"; };
EAEA85DC1811D3AE00F06E69 /* SWGStoreApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGStoreApi.h; sourceTree = "<group>"; };
EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGStoreApi.m; sourceTree = "<group>"; };
EAEA85DE1811D3AE00F06E69 /* SWGTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGTag.h; sourceTree = "<group>"; };
EAEA85DF1811D3AE00F06E69 /* SWGTag.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGTag.m; sourceTree = "<group>"; };
EAEA85E01811D3AE00F06E69 /* SWGUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGUser.h; sourceTree = "<group>"; };
EAEA85E11811D3AE00F06E69 /* SWGUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGUser.m; sourceTree = "<group>"; };
EAEA85E21811D3AE00F06E69 /* SWGUserApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGUserApi.h; sourceTree = "<group>"; };
EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGUserApi.m; sourceTree = "<group>"; };
EAFBEABA1A925B8500A27431 /* test-1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "test-1.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
EA6699931811D2FA00A70D03 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
EA66999C1811D2FA00A70D03 /* CoreGraphics.framework in Frameworks */,
EA66999E1811D2FA00A70D03 /* UIKit.framework in Frameworks */,
EA66999A1811D2FA00A70D03 /* Foundation.framework in Frameworks */,
BA525648922D4C0E9F44D4F1 /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
EA6699B71811D2FB00A70D03 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
EA8CD3ED1AC2763600C47D0B /* SenTestingKit.framework in Frameworks */,
EA6699BE1811D2FB00A70D03 /* UIKit.framework in Frameworks */,
EA6699BD1811D2FB00A70D03 /* Foundation.framework in Frameworks */,
EAB26B091AC8DE24002F5C7A /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1A15B3DE4358A178ABAEC251 /* Pods */ = {
isa = PBXGroup;
children = (
E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */,
A425648B5C0A4849C7668069 /* Pods.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
EA66998D1811D2FA00A70D03 = {
isa = PBXGroup;
children = (
EAEA85CB1811D3AE00F06E69 /* client */,
EA66999F1811D2FA00A70D03 /* SwaggerClient */,
EA6699C11811D2FB00A70D03 /* SwaggerClientTests */,
EA6699981811D2FA00A70D03 /* Frameworks */,
EA6699971811D2FA00A70D03 /* Products */,
1A15B3DE4358A178ABAEC251 /* Pods */,
);
sourceTree = "<group>";
};
EA6699971811D2FA00A70D03 /* Products */ = {
isa = PBXGroup;
children = (
EA6699961811D2FA00A70D03 /* SwaggerClient.app */,
EA6699BA1811D2FB00A70D03 /* SwaggerClientTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
EA6699981811D2FA00A70D03 /* Frameworks */ = {
isa = PBXGroup;
children = (
EAB26B081AC8DE24002F5C7A /* libPods.a */,
EA8CD3EC1AC2763600C47D0B /* SenTestingKit.framework */,
EA6699991811D2FA00A70D03 /* Foundation.framework */,
EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */,
EA66999D1811D2FA00A70D03 /* UIKit.framework */,
73DA4F1067C343C3962F1542 /* libPods.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
EA66999F1811D2FA00A70D03 /* SwaggerClient */ = {
isa = PBXGroup;
children = (
EA6699A81811D2FA00A70D03 /* AppDelegate.h */,
EA6699A91811D2FA00A70D03 /* AppDelegate.m */,
EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */,
EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */,
EA6699B11811D2FA00A70D03 /* ViewController.h */,
EA6699B21811D2FA00A70D03 /* ViewController.m */,
EA6699B41811D2FA00A70D03 /* Images.xcassets */,
EA6699A01811D2FA00A70D03 /* Supporting Files */,
);
path = SwaggerClient;
sourceTree = "<group>";
};
EA6699A01811D2FA00A70D03 /* Supporting Files */ = {
isa = PBXGroup;
children = (
EAFBEABA1A925B8500A27431 /* test-1.png */,
EA6699A11811D2FA00A70D03 /* SwaggerClient-Info.plist */,
EA6699A21811D2FA00A70D03 /* InfoPlist.strings */,
EA6699A51811D2FA00A70D03 /* main.m */,
EA6699A71811D2FA00A70D03 /* SwaggerClient-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
EA6699C11811D2FB00A70D03 /* SwaggerClientTests */ = {
isa = PBXGroup;
children = (
EA8CD3EB1AC274BE00C47D0B /* PetApiTest.h */,
CF5B6E2C1B2BD70800862A1C /* UserApiTest.m */,
CFB37D051B2B11DC00D2E5F1 /* StoreApiTest.m */,
CF31D0981B105E4B00509935 /* SWGApiClientTest.m */,
EA6699C71811D2FB00A70D03 /* PetApiTest.m */,
EA6699C21811D2FB00A70D03 /* Supporting Files */,
);
path = SwaggerClientTests;
sourceTree = "<group>";
};
EA6699C21811D2FB00A70D03 /* Supporting Files */ = {
isa = PBXGroup;
children = (
EA6699C31811D2FB00A70D03 /* SwaggerClientTests-Info.plist */,
EA6699C41811D2FB00A70D03 /* InfoPlist.strings */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
EAEA85CB1811D3AE00F06E69 /* client */ = {
isa = PBXGroup;
children = (
CFD1B66E1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.h */,
CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */,
EA8B8AA21AC6683700638FBB /* SWGQueryParamCollection.h */,
EA8B8AA31AC6683700638FBB /* SWGQueryParamCollection.m */,
EAEA85CC1811D3AE00F06E69 /* SWGApiClient.h */,
EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */,
CF0560E91B1855CF00C0D4EC /* SWGConfiguration.h */,
CF0560EA1B1855CF00C0D4EC /* SWGConfiguration.m */,
EAEA85CE1811D3AE00F06E69 /* SWGCategory.h */,
EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */,
EAEA85D21811D3AE00F06E69 /* SWGFile.h */,
EAEA85D31811D3AE00F06E69 /* SWGFile.m */,
EAEA85D41811D3AE00F06E69 /* SWGObject.h */,
EAEA85D51811D3AE00F06E69 /* SWGObject.m */,
EAEA85D61811D3AE00F06E69 /* SWGOrder.h */,
EAEA85D71811D3AE00F06E69 /* SWGOrder.m */,
EAB26B0E1AC8E692002F5C7A /* SWGPet.h */,
CFCEFE4F1B2C1330006313BE /* SWGJSONResponseSerializer.h */,
CFCEFE501B2C1330006313BE /* SWGJSONResponseSerializer.m */,
EAEA85D91811D3AE00F06E69 /* SWGPet.m */,
EAEA85DA1811D3AE00F06E69 /* SWGPetApi.h */,
EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */,
EAEA85DC1811D3AE00F06E69 /* SWGStoreApi.h */,
EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */,
EAEA85DE1811D3AE00F06E69 /* SWGTag.h */,
EAEA85DF1811D3AE00F06E69 /* SWGTag.m */,
EAEA85E01811D3AE00F06E69 /* SWGUser.h */,
EAEA85E11811D3AE00F06E69 /* SWGUser.m */,
EAEA85E21811D3AE00F06E69 /* SWGUserApi.h */,
EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */,
);
name = client;
path = ../client;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
EA6699951811D2FA00A70D03 /* SwaggerClient */ = {
isa = PBXNativeTarget;
buildConfigurationList = EA6699CB1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "SwaggerClient" */;
buildPhases = (
04DAA264FD78471BBAD25173 /* Check Pods Manifest.lock */,
EA6699921811D2FA00A70D03 /* Sources */,
EA6699931811D2FA00A70D03 /* Frameworks */,
3692D11BB04F489DAA7C0B6A /* Copy Pods Resources */,
EA6699941811D2FA00A70D03 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SwaggerClient;
productName = PetstoreClient;
productReference = EA6699961811D2FA00A70D03 /* SwaggerClient.app */;
productType = "com.apple.product-type.application";
};
EA6699B91811D2FB00A70D03 /* SwaggerClientTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = EA6699CE1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */;
buildPhases = (
EA6699B61811D2FB00A70D03 /* Sources */,
EA6699B71811D2FB00A70D03 /* Frameworks */,
EA6699B81811D2FB00A70D03 /* Resources */,
);
buildRules = (
);
dependencies = (
EA6699C01811D2FB00A70D03 /* PBXTargetDependency */,
);
name = SwaggerClientTests;
productName = PetstoreClientTests;
productReference = EA6699BA1811D2FB00A70D03 /* SwaggerClientTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
EA66998E1811D2FA00A70D03 /* Project object */ = {
isa = PBXProject;
attributes = {
LastTestingUpgradeCheck = 0620;
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = Reverb;
TargetAttributes = {
EA6699B91811D2FB00A70D03 = {
TestTargetID = EA6699951811D2FA00A70D03;
};
};
};
buildConfigurationList = EA6699911811D2FA00A70D03 /* Build configuration list for PBXProject "SwaggerClient" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = EA66998D1811D2FA00A70D03;
productRefGroup = EA6699971811D2FA00A70D03 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
EA6699951811D2FA00A70D03 /* SwaggerClient */,
EA6699B91811D2FB00A70D03 /* SwaggerClientTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
EA6699941811D2FA00A70D03 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EA6699B01811D2FA00A70D03 /* Main_iPad.storyboard in Resources */,
EA6699B51811D2FA00A70D03 /* Images.xcassets in Resources */,
EA6699AD1811D2FA00A70D03 /* Main_iPhone.storyboard in Resources */,
EAFBEABB1A925B8500A27431 /* test-1.png in Resources */,
EA6699A41811D2FA00A70D03 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
EA6699B81811D2FB00A70D03 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EA6699C61811D2FB00A70D03 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
04DAA264FD78471BBAD25173 /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
3692D11BB04F489DAA7C0B6A /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
EA6699921811D2FA00A70D03 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EAEA85E51811D3AE00F06E69 /* SWGCategory.m in Sources */,
CF0560EB1B1855CF00C0D4EC /* SWGConfiguration.m in Sources */,
EAEA85ED1811D3AE00F06E69 /* SWGTag.m in Sources */,
EA6699B31811D2FA00A70D03 /* ViewController.m in Sources */,
EA6699AA1811D2FA00A70D03 /* AppDelegate.m in Sources */,
EAEA85EE1811D3AE00F06E69 /* SWGUser.m in Sources */,
EAEA85EF1811D3AE00F06E69 /* SWGUserApi.m in Sources */,
EAEA85EB1811D3AE00F06E69 /* SWGPetApi.m in Sources */,
EA6699A61811D2FA00A70D03 /* main.m in Sources */,
CFD1B6701B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */,
EAEA85EA1811D3AE00F06E69 /* SWGPet.m in Sources */,
EAEA85E41811D3AE00F06E69 /* SWGApiClient.m in Sources */,
EAEA85EC1811D3AE00F06E69 /* SWGStoreApi.m in Sources */,
EAEA85E91811D3AE00F06E69 /* SWGOrder.m in Sources */,
EAEA85E81811D3AE00F06E69 /* SWGObject.m in Sources */,
EA8B8AA41AC6683700638FBB /* SWGQueryParamCollection.m in Sources */,
CFCEFE511B2C1330006313BE /* SWGJSONResponseSerializer.m in Sources */,
EAEA85E71811D3AE00F06E69 /* SWGFile.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
EA6699B61811D2FB00A70D03 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EAB26B0C1AC8DF78002F5C7A /* PetApiTest.h in Sources */,
CFD1B6711B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */,
EAB26B0D1AC8DF78002F5C7A /* PetApiTest.m in Sources */,
CF5B6E2D1B2BD70800862A1C /* UserApiTest.m in Sources */,
CFB37D061B2B11DD00D2E5F1 /* StoreApiTest.m in Sources */,
CF31D0991B105E4B00509935 /* SWGApiClientTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
EA6699C01811D2FB00A70D03 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = EA6699951811D2FA00A70D03 /* SwaggerClient */;
targetProxy = EA6699BF1811D2FB00A70D03 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
EA6699A21811D2FA00A70D03 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
EA6699A31811D2FA00A70D03 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
EA6699AC1811D2FA00A70D03 /* Base */,
);
name = Main_iPhone.storyboard;
sourceTree = "<group>";
};
EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
EA6699AF1811D2FA00A70D03 /* Base */,
);
name = Main_iPad.storyboard;
sourceTree = "<group>";
};
EA6699C41811D2FB00A70D03 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
EA6699C51811D2FB00A70D03 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
EA6699C91811D2FB00A70D03 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
EA6699CA1811D2FB00A70D03 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
EA6699CC1811D2FB00A70D03 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos",
);
PRODUCT_NAME = SwaggerClient;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
EA6699CD1811D2FB00A70D03 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A425648B5C0A4849C7668069 /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos",
);
PRODUCT_NAME = SwaggerClient;
WRAPPER_EXTENSION = app;
};
name = Release;
};
EA6699CF1811D2FB00A70D03 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "SwaggerClientTests/SwaggerClientTests-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos",
);
PRODUCT_NAME = SwaggerClientTests;
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
EA6699D01811D2FB00A70D03 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A425648B5C0A4849C7668069 /* Pods.release.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClientTests/SwaggerClientTests-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos",
);
PRODUCT_NAME = SwaggerClientTests;
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
EA6699911811D2FA00A70D03 /* Build configuration list for PBXProject "SwaggerClient" */ = {
isa = XCConfigurationList;
buildConfigurations = (
EA6699C91811D2FB00A70D03 /* Debug */,
EA6699CA1811D2FB00A70D03 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
EA6699CB1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = {
isa = XCConfigurationList;
buildConfigurations = (
EA6699CC1811D2FB00A70D03 /* Debug */,
EA6699CD1811D2FB00A70D03 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
EA6699CE1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
EA6699CF1811D2FB00A70D03 /* Debug */,
EA6699D01811D2FB00A70D03 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = EA66998E1811D2FA00A70D03 /* Project object */;
}

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>7A33CEA3-5D3F-4B6D-8F47-84701AB3E283</string>
<key>IDESourceControlProjectName</key>
<string>PetstoreClient</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>92840518-904D-4771-AA3D-9AF52CA48B71</key>
<string>ssh://github.com/wordnik/swagger-codegen.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>samples/client/petstore/objc/PetstoreClient/PetstoreClient.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>92840518-904D-4771-AA3D-9AF52CA48B71</key>
<string>../../../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://github.com/wordnik/swagger-codegen.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>92840518-904D-4771-AA3D-9AF52CA48B71</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>92840518-904D-4771-AA3D-9AF52CA48B71</string>
<key>IDESourceControlWCCName</key>
<string>swagger-codegen</string>
</dict>
</array>
</dict>
</plist>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>SwaggerClient.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>EA6699951811D2FA00A70D03</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>EA6699B91811D2FB00A70D03</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "PetstoreClient.app"
BlueprintName = "PetstoreClient"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699B91811D2FB00A70D03"
BuildableName = "PetstoreClientTests.xctest"
BlueprintName = "PetstoreClientTests"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "PetstoreClient.app"
BlueprintName = "PetstoreClient"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "PetstoreClient.app"
BlueprintName = "PetstoreClient"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "PetstoreClient.app"
BlueprintName = "PetstoreClient"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,15 +0,0 @@
//
// AppDelegate.h
// PetstoreClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="20" width="768" height="1004"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View File

@ -1,58 +0,0 @@
{
"images": [
{
"idiom": "iphone",
"size": "29x29",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "40x40",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "60x60",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "60x60",
"scale": "3x"
},
{
"idiom": "ipad",
"size": "29x29",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "29x29",
"scale": "2x"
},
{
"idiom": "ipad",
"size": "40x40",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "40x40",
"scale": "2x"
},
{
"idiom": "ipad",
"size": "76x76",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "76x76",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

View File

@ -1,51 +0,0 @@
{
"images": [
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "iphone",
"subtype": "retina4",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "1x"
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "1x"
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x"
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

View File

@ -1,13 +0,0 @@
//
// ViewController.h
// PetstoreClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end

View File

@ -1,75 +0,0 @@
//
// ViewController.m
// PetstoreClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
//
#import "ViewController.h"
#import "SWGPetApi.h"
#import "SWGStoreApi.h"
#import "SWGUserApi.h"
#import "SWGConfiguration.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
/*
SWGPetApi * api = [[SWGPetApi alloc] init];
[api getPetByIdWithCompletionBlock:@10 completionHandler:^(SWGPet *output, NSError *error) {
NSLog(@"%@", [output asDictionary]);
[output set_id:@101];
[api addPetWithCompletionBlock:output completionHandler:^(NSError *error) {
NSLog(@"Done!");
}];
// load data into file
}];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test-1" ofType:@"png"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];
SWGFile *file = [[SWGFile alloc] initWithNameData:@"test-2.png" mimeType:@"image/png" data:myData];
[api uploadFileWithCompletionBlock:@1
additionalMetadata:@"some metadata"
file:file
completionHandler:^(NSError *error) {
if(error) {
NSLog(@"%@", error);
}
}
// completionHandler:^(SWGApiResponse *output, NSError *error) {
// if(error) {
// NSLog(@"%@", error);
// }
// else {
// NSLog(@"%@", [output asDictionary]);
// }
// }
];
*/
SWGPetApi *api = [[SWGPetApi alloc] init];
[api deletePetWithCompletionBlock:@"hello"
petId:@1434529787992
completionHandler:^(NSError *error) {
if (error) {
NSLog(@"%@", error);
}
}];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end

View File

@ -1,18 +0,0 @@
//
// main.m
// PetstoreClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 KiB

View File

@ -1,9 +0,0 @@
#import <XCTest/XCTest.h>
#import "SWGPetApi.h"
@interface PetApiTest : XCTestCase {
@private
SWGPetApi * api;
}
@end

View File

@ -1,24 +0,0 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>de.felixschulze.my-project</groupId>
<artifactId>PetstoreClient</artifactId>
<packaging>xcode</packaging>
<version>1.0-SNAPSHOT</version>
<name>Swagger Petstore Client</name>
<build>
<plugins>
<plugin>
<groupId>de.felixschulze.maven.plugins.xcode</groupId>
<artifactId>xcode-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<xcodeProject>PetstoreClient.xcodeproj</xcodeProject>
<xcodeTarget>PetstoreClient</xcodeTarget>
<xcodeConfiguration>Debug</xcodeConfiguration>
<xcodeSdk>iphoneos</xcodeSdk>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,12 @@
source 'https://github.com/CocoaPods/Specs.git'
target 'SwaggerClient_Example', :exclusive => true do
pod "SwaggerClient", :path => "../"
end
target 'SwaggerClient_Tests', :exclusive => true do
pod "SwaggerClient", :path => "../"
pod 'Specta'
pod 'Expecta'
end

View File

@ -0,0 +1,587 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */; };
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SWGAppDelegate.m */; };
6003F5A7195388D20070C39A /* SWGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SWGViewController.m */; };
6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; };
CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */; };
CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */; };
CFDFB4141B3CFFF6009739C5 /* StoreApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */; };
CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6003F582195388D10070C39A /* Project object */;
proxyType = 1;
remoteGlobalIDString = 6003F589195388D20070C39A;
remoteInfo = SwaggerClient;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.release.xcconfig"; sourceTree = "<group>"; };
4CCE21315897B7D544C83242 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
6003F58A195388D20070C39A /* SwaggerClient_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
6003F595195388D20070C39A /* SwaggerClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClient-Info.plist"; sourceTree = "<group>"; };
6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = "<group>"; };
6003F59C195388D20070C39A /* SWGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGAppDelegate.h; sourceTree = "<group>"; };
6003F59D195388D20070C39A /* SWGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGAppDelegate.m; sourceTree = "<group>"; };
6003F5A5195388D20070C39A /* SWGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGViewController.h; sourceTree = "<group>"; };
6003F5A6195388D20070C39A /* SWGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGViewController.m; sourceTree = "<group>"; };
6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClient_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; };
6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig"; sourceTree = "<group>"; };
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig"; sourceTree = "<group>"; };
CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetApiTest.m; sourceTree = "<group>"; };
CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreApiTest.m; sourceTree = "<group>"; };
CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClientTest.m; sourceTree = "<group>"; };
CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserApiTest.m; sourceTree = "<group>"; };
E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.debug.xcconfig"; sourceTree = "<group>"; };
E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwaggerClient.podspec; path = ../SwaggerClient.podspec; sourceTree = "<group>"; };
FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
6003F587195388D20070C39A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AB195388D20070C39A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6003F581195388D10070C39A = {
isa = PBXGroup;
children = (
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
6003F593195388D20070C39A /* Example for SwaggerClient */,
6003F5B5195388D20070C39A /* Tests */,
6003F58C195388D20070C39A /* Frameworks */,
6003F58B195388D20070C39A /* Products */,
CCE77F10C6D41F74B075ECD0 /* Pods */,
);
sourceTree = "<group>";
};
6003F58B195388D20070C39A /* Products */ = {
isa = PBXGroup;
children = (
6003F58A195388D20070C39A /* SwaggerClient_Example.app */,
6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
6003F58C195388D20070C39A /* Frameworks */ = {
isa = PBXGroup;
children = (
6003F58D195388D20070C39A /* Foundation.framework */,
6003F58F195388D20070C39A /* CoreGraphics.framework */,
6003F591195388D20070C39A /* UIKit.framework */,
6003F5AF195388D20070C39A /* XCTest.framework */,
8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */,
FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
6003F593195388D20070C39A /* Example for SwaggerClient */ = {
isa = PBXGroup;
children = (
6003F59C195388D20070C39A /* SWGAppDelegate.h */,
6003F59D195388D20070C39A /* SWGAppDelegate.m */,
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
6003F5A5195388D20070C39A /* SWGViewController.h */,
6003F5A6195388D20070C39A /* SWGViewController.m */,
6003F5A8195388D20070C39A /* Images.xcassets */,
6003F594195388D20070C39A /* Supporting Files */,
);
name = "Example for SwaggerClient";
path = SwaggerClient;
sourceTree = "<group>";
};
6003F594195388D20070C39A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6003F595195388D20070C39A /* SwaggerClient-Info.plist */,
6003F596195388D20070C39A /* InfoPlist.strings */,
6003F599195388D20070C39A /* main.m */,
6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
6003F5B5195388D20070C39A /* Tests */ = {
isa = PBXGroup;
children = (
CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */,
CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */,
CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */,
CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */,
6003F5BB195388D20070C39A /* Tests.m */,
6003F5B6195388D20070C39A /* Supporting Files */,
);
path = Tests;
sourceTree = "<group>";
};
6003F5B6195388D20070C39A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6003F5B7195388D20070C39A /* Tests-Info.plist */,
6003F5B8195388D20070C39A /* InfoPlist.strings */,
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
isa = PBXGroup;
children = (
E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */,
4CCE21315897B7D544C83242 /* README.md */,
);
name = "Podspec Metadata";
sourceTree = "<group>";
};
CCE77F10C6D41F74B075ECD0 /* Pods */ = {
isa = PBXGroup;
children = (
E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */,
BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */,
73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */,
1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
6003F589195388D20070C39A /* SwaggerClient_Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */;
buildPhases = (
799E7E29D924C30424DFBA28 /* Check Pods Manifest.lock */,
6003F586195388D20070C39A /* Sources */,
6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */,
429AF5C69E165ED75311B4B0 /* Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = SwaggerClient_Example;
productName = SwaggerClient;
productReference = 6003F58A195388D20070C39A /* SwaggerClient_Example.app */;
productType = "com.apple.product-type.application";
};
6003F5AD195388D20070C39A /* SwaggerClient_Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */;
buildPhases = (
7B069562A9F91E498732474F /* Check Pods Manifest.lock */,
6003F5AA195388D20070C39A /* Sources */,
6003F5AB195388D20070C39A /* Frameworks */,
6003F5AC195388D20070C39A /* Resources */,
E337D7E459CCFFDF27046FFC /* Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
6003F5B4195388D20070C39A /* PBXTargetDependency */,
);
name = SwaggerClient_Tests;
productName = SwaggerClientTests;
productReference = 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
6003F582195388D10070C39A /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = SWG;
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = geekerzp;
};
buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 6003F581195388D10070C39A;
productRefGroup = 6003F58B195388D20070C39A /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
6003F589195388D20070C39A /* SwaggerClient_Example */,
6003F5AD195388D20070C39A /* SwaggerClient_Tests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
6003F588195388D20070C39A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AC195388D20070C39A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
429AF5C69E165ED75311B4B0 /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
799E7E29D924C30424DFBA28 /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
7B069562A9F91E498732474F /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
E337D7E459CCFFDF27046FFC /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
6003F586195388D20070C39A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */,
6003F5A7195388D20070C39A /* SWGViewController.m in Sources */,
6003F59A195388D20070C39A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AA195388D20070C39A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CFDFB4141B3CFFF6009739C5 /* StoreApiTest.m in Sources */,
CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */,
6003F5BC195388D20070C39A /* Tests.m in Sources */,
CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */,
CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
6003F5B4195388D20070C39A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 6003F589195388D20070C39A /* SwaggerClient_Example */;
targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
6003F596195388D20070C39A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6003F597195388D20070C39A /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
6003F5B8195388D20070C39A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6003F5B9195388D20070C39A /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
6003F5BD195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
6003F5BE195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
6003F5C0195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist";
MODULE_NAME = ExampleApp;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
6003F5C1195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist";
MODULE_NAME = ExampleApp;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
6003F5C3195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "Tests/Tests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
6003F5C4195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
INFOPLIST_FILE = "Tests/Tests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5BD195388D20070C39A /* Debug */,
6003F5BE195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5C0195388D20070C39A /* Debug */,
6003F5C1195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5C3195388D20070C39A /* Debug */,
6003F5C4195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 6003F582195388D10070C39A /* Project object */;
}

View File

@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:PetstoreClient.xcodeproj"> location = "self:SwaggerClient.xcodeproj">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@ -5,7 +5,7 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key> <key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/> <false/>
<key>IDESourceControlProjectIdentifier</key> <key>IDESourceControlProjectIdentifier</key>
<string>15AAFA18-9D61-437F-988D-A691BA4C08B1</string> <string>303FE0A9-4715-4C57-8D01-F604EF82CF6D</string>
<key>IDESourceControlProjectName</key> <key>IDESourceControlProjectName</key>
<string>SwaggerClient</string> <string>SwaggerClient</string>
<key>IDESourceControlProjectOriginsDictionary</key> <key>IDESourceControlProjectOriginsDictionary</key>
@ -14,11 +14,11 @@
<string>https://github.com/geekerzp/swagger-codegen.git</string> <string>https://github.com/geekerzp/swagger-codegen.git</string>
</dict> </dict>
<key>IDESourceControlProjectPath</key> <key>IDESourceControlProjectPath</key>
<string>samples/client/petstore/objc/SwaggerClient.xcworkspace</string> <string>samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key> <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict> <dict>
<key>E5BBF0AA85077C865C95437976D06D819733A208</key> <key>E5BBF0AA85077C865C95437976D06D819733A208</key>
<string>../../../../..</string> <string>../../../../../../..</string>
</dict> </dict>
<key>IDESourceControlProjectURL</key> <key>IDESourceControlProjectURL</key>
<string>https://github.com/geekerzp/swagger-codegen.git</string> <string>https://github.com/geekerzp/swagger-codegen.git</string>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0630" LastUpgradeVersion = "0600"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@ -14,23 +14,9 @@
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03" BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "SwaggerClient.app" BuildableName = "SwaggerClient_Example.app"
BlueprintName = "SwaggerClient" BlueprintName = "SwaggerClient_Example"
ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699B91811D2FB00A70D03"
BuildableName = "SwaggerClientTests.xctest"
BlueprintName = "SwaggerClientTests"
ReferencedContainer = "container:SwaggerClient.xcodeproj"> ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
@ -46,9 +32,9 @@
skipped = "NO"> skipped = "NO">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699B91811D2FB00A70D03" BlueprintIdentifier = "6003F5AD195388D20070C39A"
BuildableName = "SwaggerClientTests.xctest" BuildableName = "SwaggerClient_Tests.xctest"
BlueprintName = "SwaggerClientTests" BlueprintName = "SwaggerClient_Tests"
ReferencedContainer = "container:SwaggerClient.xcodeproj"> ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference> </BuildableReference>
</TestableReference> </TestableReference>
@ -56,9 +42,9 @@
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03" BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "SwaggerClient.app" BuildableName = "SwaggerClient_Example.app"
BlueprintName = "SwaggerClient" BlueprintName = "SwaggerClient_Example"
ReferencedContainer = "container:SwaggerClient.xcodeproj"> ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
@ -76,9 +62,9 @@
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03" BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "SwaggerClient.app" BuildableName = "SwaggerClient_Example.app"
BlueprintName = "SwaggerClient" BlueprintName = "SwaggerClient_Example"
ReferencedContainer = "container:SwaggerClient.xcodeproj"> ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
@ -95,9 +81,9 @@
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03" BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "SwaggerClient.app" BuildableName = "SwaggerClient_Example.app"
BlueprintName = "SwaggerClient" BlueprintName = "SwaggerClient_Example"
ReferencedContainer = "container:SwaggerClient.xcodeproj"> ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>

View File

@ -2,22 +2,14 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>SchemeUserState</key>
<dict>
<key>PetstoreClient.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key> <key>SuppressBuildableAutocreation</key>
<dict> <dict>
<key>EA6699951811D2FA00A70D03</key> <key>6003F589195388D20070C39A</key>
<dict> <dict>
<key>primary</key> <key>primary</key>
<true/> <true/>
</dict> </dict>
<key>EA6699B91811D2FB00A70D03</key> <key>6003F5AD195388D20070C39A</key>
<dict> <dict>
<key>primary</key> <key>primary</key>
<true/> <true/>

View File

@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,51 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"subtype" : "retina4",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="wQg-tq-qST">
<objects>
<viewController id="whP-gf-Uak" customClass="SWGViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/>
<viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="305" y="433"/>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,15 @@
//
// SWGAppDelegate.h
// SwaggerClient
//
// Created by CocoaPods on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
@import UIKit;
@interface SWGAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

View File

@ -1,14 +1,14 @@
// //
// AppDelegate.m // SWGAppDelegate.m
// PetstoreClient // SwaggerClient
// //
// Created by Tony Tam on 10/18/13. // Created by CocoaPods on 06/26/2015.
// Copyright (c) 2015 SmartBear Software. All rights reserved. // Copyright (c) 2014 geekerzp. All rights reserved.
// //
#import "AppDelegate.h" #import "SWGAppDelegate.h"
@implementation AppDelegate @implementation SWGAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {

View File

@ -0,0 +1,13 @@
//
// SWGViewController.h
// SwaggerClient
//
// Created by geekerzp on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
@import UIKit;
@interface SWGViewController : UIViewController
@end

View File

@ -0,0 +1,29 @@
//
// SWGViewController.m
// SwaggerClient
//
// Created by geekerzp on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
#import "SWGViewController.h"
@interface SWGViewController ()
@end
@implementation SWGViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end

View File

@ -9,7 +9,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.reverb.${PRODUCT_NAME:rfc1034identifier}</string> <string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@ -25,9 +25,7 @@
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main_iPhone</string> <string>Main</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Main_iPad</string>
<key>UIRequiredDeviceCapabilities</key> <key>UIRequiredDeviceCapabilities</key>
<array> <array>
<string>armv7</string> <string>armv7</string>

View File

@ -11,7 +11,6 @@
#endif #endif
#ifdef __OBJC__ #ifdef __OBJC__
#import <UIKit/UIKit.h> @import UIKit;
#import <Foundation/Foundation.h> @import Foundation;
#import <SystemConfiguration/SystemConfiguration.h>
#endif #endif

View File

@ -0,0 +1,17 @@
//
// main.m
// SwaggerClient
//
// Created by geekerzp on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
@import UIKit;
#import "SWGAppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([SWGAppDelegate class]));
}
}

Some files were not shown because too many files have changed in this diff Show More