diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java index d8b20ae5dd06..a9d827fd1a53 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java @@ -245,8 +245,8 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("Object-body.mustache", coreFileFolder(), classPrefix + "Object.m")); supportingFiles.add(new SupportingFile("QueryParamCollection-header.mustache", coreFileFolder(), classPrefix + "QueryParamCollection.h")); supportingFiles.add(new SupportingFile("QueryParamCollection-body.mustache", coreFileFolder(), classPrefix + "QueryParamCollection.m")); - supportingFiles.add(new SupportingFile("ApiClient-header.mustache", coreFileFolder(), classPrefix + "ApiClient.h")); - supportingFiles.add(new SupportingFile("ApiClient-body.mustache", coreFileFolder(), classPrefix + "ApiClient.m")); + supportingFiles.add(new SupportingFile("ApiClient-header.mustache", coreFileFolder(), classPrefix + "ApiClient.h")); + supportingFiles.add(new SupportingFile("ApiClient-body.mustache", coreFileFolder(), classPrefix + "ApiClient.m")); supportingFiles.add(new SupportingFile("JSONResponseSerializer-header.mustache", coreFileFolder(), classPrefix + "JSONResponseSerializer.h")); supportingFiles.add(new SupportingFile("JSONResponseSerializer-body.mustache", coreFileFolder(), classPrefix + "JSONResponseSerializer.m")); supportingFiles.add(new SupportingFile("JSONRequestSerializer-body.mustache", coreFileFolder(), classPrefix + "JSONRequestSerializer.m")); @@ -259,8 +259,11 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("Logger-header.mustache", coreFileFolder(), classPrefix + "Logger.h")); supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601-body.mustache", coreFileFolder(), "JSONValueTransformer+ISO8601.m")); supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601-header.mustache", coreFileFolder(), "JSONValueTransformer+ISO8601.h")); - supportingFiles.add(new SupportingFile("Configuration-body.mustache", coreFileFolder(), classPrefix + "Configuration.m")); - supportingFiles.add(new SupportingFile("Configuration-header.mustache", coreFileFolder(), classPrefix + "Configuration.h")); + supportingFiles.add(new SupportingFile("Configuration-protocol.mustache", coreFileFolder(), classPrefix + "Configuration.h")); + supportingFiles.add(new SupportingFile("DefaultConfiguration-body.mustache", coreFileFolder(), classPrefix + "DefaultConfiguration.m")); + supportingFiles.add(new SupportingFile("DefaultConfiguration-header.mustache", coreFileFolder(), classPrefix + "DefaultConfiguration.h")); + supportingFiles.add(new SupportingFile("BasicAuthTokenProvider-header.mustache", coreFileFolder(), classPrefix + "BasicAuthTokenProvider.h")); + supportingFiles.add(new SupportingFile("BasicAuthTokenProvider-body.mustache", coreFileFolder(), classPrefix + "BasicAuthTokenProvider.m")); supportingFiles.add(new SupportingFile("api-protocol.mustache", coreFileFolder(), classPrefix + "Api.h")); supportingFiles.add(new SupportingFile("podspec.mustache", "", podName + ".podspec")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache index 10cb6528d86d..94529bf6dda7 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache @@ -1,10 +1,16 @@ +#import + #import "{{classPrefix}}ApiClient.h" +#import "{{classPrefix}}JSONRequestSerializer.h" +#import "{{classPrefix}}JSONResponseSerializer.h" +#import "{{classPrefix}}QueryParamCollection.h" +#import "{{classPrefix}}DefaultConfiguration.h" + + NSString *const {{classPrefix}}ResponseObjectErrorKey = @"{{classPrefix}}ResponseObject"; -static NSUInteger requestId = 0; static bool offlineState = false; -static NSMutableSet * queuedRequests = nil; static bool cacheEnabled = false; static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable; static void (^reachabilityChangeBlock)(int); @@ -36,38 +42,61 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) @interface {{classPrefix}}ApiClient () -@property (nonatomic, strong) NSDictionary* HTTPResponseHeaders; +@property (nonatomic, strong, readwrite) id<{{classPrefix}}Configuration> configuration; @end @implementation {{classPrefix}}ApiClient +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static {{classPrefix}}ApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + - (instancetype)init { - NSString *baseUrl = [[{{classPrefix}}Configuration sharedConfig] host]; - return [self initWithBaseURL:[NSURL URLWithString:baseUrl]]; + + return [self initWithConfiguration:[{{classPrefix}}DefaultConfiguration sharedConfig]]; } - (instancetype)initWithBaseURL:(NSURL *)url { + + return [self initWithBaseURL:url + configuration:[{{classPrefix}}DefaultConfiguration sharedConfig]]; + +} + +- (instancetype)initWithConfiguration:(id<{{classPrefix}}Configuration>)configuration { + + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url + configuration:(id<{{classPrefix}}Configuration>)configuration { + self = [super initWithBaseURL:url]; if (self) { - self.timeoutInterval = 60; + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[{{classPrefix}}ResponseDeserializer alloc] init]; + _sanitizer = [[{{classPrefix}}Sanitizer alloc] init]; + self.requestSerializer = [AFJSONRequestSerializer serializer]; self.responseSerializer = [AFJSONResponseSerializer serializer]; self.securityPolicy = [self customSecurityPolicy]; - self.responseDeserializer = [[{{classPrefix}}ResponseDeserializer alloc] init]; - self.sanitizer = [[{{classPrefix}}Sanitizer alloc] init]; + // configure reachability [self configureCacheReachibility]; } - return self; -} -+ (void)initialize { - if (self == [{{classPrefix}}ApiClient class]) { - queuedRequests = [[NSMutableSet alloc] init]; - // initialize URL cache - [self configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024]; - } + return self; } #pragma mark - Setter Methods @@ -113,43 +142,6 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) [NSURLCache setSharedURLCache:cache]; } -#pragma mark - Request Methods - -+(NSUInteger)requestQueueSize { - return [queuedRequests count]; -} - -+(NSNumber*) nextRequestId { - @synchronized(self) { - return @(++requestId); - } -} - -+(NSNumber*) queueRequest { - NSNumber* requestId = [[self class] nextRequestId]; - {{classPrefix}}DebugLog(@"added %@ to request queue", requestId); - [queuedRequests addObject:requestId]; - return requestId; -} - -+(void) cancelRequest:(NSNumber*)requestId { - [queuedRequests removeObject:requestId]; -} - --(Boolean) executeRequestWithId:(NSNumber*) requestId { - NSSet* matchingItems = [queuedRequests objectsPassingTest:^BOOL(id obj, BOOL *stop) { - return [obj intValue] == [requestId intValue]; - }]; - - if (matchingItems.count == 1) { - {{classPrefix}}DebugLog(@"removed request id %@", requestId); - [queuedRequests removeObject:requestId]; - return YES; - } else { - return NO; - } -} - #pragma mark - Reachability Methods +(AFNetworkReachabilityStatus) getReachabilityStatus { @@ -179,23 +171,19 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) [self.reachabilityManager startMonitoring]; } -#pragma mark - Operation Methods +#pragma mark - Task Methods -- (void) operationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request + completionBlock: (void (^)(id, NSError *))completionBlock { + + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { {{classPrefix}}DebugLogResponse(response, responseObject,request,error); - strongSelf.HTTPResponseHeaders = {{classPrefix}}__headerFieldsForResponse(response); + if(!error) { completionBlock(responseObject, nil); return; } + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; if (responseObject) { // Add in the (parsed) response body. @@ -204,20 +192,18 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - [op resume]; + + return task; } -- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } - strongSelf.HTTPResponseHeaders = {{classPrefix}}__headerFieldsForResponse(response); +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request + completionBlock: (void (^)(id, NSError *))completionBlock { + + id<{{classPrefix}}Configuration> config = self.configuration; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { {{classPrefix}}DebugLogResponse(response, responseObject,request,error); + if(error) { NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; if (responseObject) { @@ -226,8 +212,9 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); } - NSString *directory = [self configuration].tempFolderPath ?: NSTemporaryDirectory(); - NSString * filename = {{classPrefix}}__fileNameForResponse(response); + + NSString *directory = config.tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = {{classPrefix}}__fileNameForResponse(response); NSString *filepath = [directory stringByAppendingPathComponent:filename]; NSURL *file = [NSURL fileURLWithPath:filepath]; @@ -236,24 +223,26 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) completionBlock(file, nil); }]; - [op resume]; + + return task; } -#pragma mark - Perform Request Methods +#pragma mark - Perform Request Methods + +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { --(NSNumber*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock { // setting request serializer if ([requestContentType isEqualToString:@"application/json"]) { self.requestSerializer = [{{classPrefix}}JSONRequestSerializer serializer]; @@ -359,14 +348,16 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) [self postProcessRequest:request]; - NSNumber* requestId = [{{classPrefix}}ApiClient queueRequest]; + + NSURLSessionTask *task = nil; + if ([responseType isEqualToString:@"NSURL*"] || [responseType isEqualToString:@"NSURL"]) { - [self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { completionBlock(data, error); }]; } else { - [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { NSError * serializationError; id response = [self.responseDeserializer deserialize:data class:responseType error:&serializationError]; if(!response && !error){ @@ -375,7 +366,10 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) completionBlock(response, error); }]; } - return requestId; + + [task resume]; + + return task; } //Added for easier override to modify request @@ -455,10 +449,11 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - - NSDictionary* configurationAuthSettings = [[self configuration] authSettings]; + + id<{{classPrefix}}Configuration> config = self.configuration; for (NSString *auth in authSettings) { - NSDictionary *authSetting = configurationAuthSettings[auth]; + NSDictionary *authSetting = config.authSettings[auth]; + if(!authSetting) { // auth setting is set only if the key is non-empty continue; } @@ -479,11 +474,11 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) - (AFSecurityPolicy *) customSecurityPolicy { AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - {{classPrefix}}Configuration *config = [self configuration]; + id<{{classPrefix}}Configuration> config = self.configuration; if (config.sslCaCert) { NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; - [securityPolicy setPinnedCertificates:@[certData]]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; } if (config.verifySSL) { @@ -497,8 +492,4 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) return securityPolicy; } -- ({{classPrefix}}Configuration*) configuration { - return [{{classPrefix}}Configuration sharedConfig]; -} - @end diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache index be5eba32ee01..7a128929bbe2 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache @@ -1,22 +1,10 @@ -#import -#import #import -#import "{{classPrefix}}JSONResponseSerializer.h" -#import "{{classPrefix}}JSONRequestSerializer.h" -#import "{{classPrefix}}QueryParamCollection.h" #import "{{classPrefix}}Configuration.h" #import "{{classPrefix}}ResponseDeserializer.h" #import "{{classPrefix}}Sanitizer.h" -#import "{{classPrefix}}Logger.h" {{>licenceInfo}} -{{#models}}{{#model}}#import "{{classname}}.h" -{{/model}}{{/models}} -{{^models}}#import "{{classPrefix}}Object.h"{{/models}} - -@class {{classPrefix}}Configuration; - /** * A key for `NSError` user info dictionaries. * @@ -24,15 +12,15 @@ */ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; + @interface {{classPrefix}}ApiClient : AFHTTPSessionManager +@property (nonatomic, strong, readonly) id<{{classPrefix}}Configuration> configuration; + @property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy; @property(nonatomic, assign) NSTimeInterval timeoutInterval; @property(nonatomic, readonly) NSOperationQueue* queue; -/// In order to ensure the HTTPResponseHeaders are correct, it is recommended to initialize one {{classPrefix}}ApiClient instance per thread. -@property(nonatomic, readonly) NSDictionary* HTTPResponseHeaders; - @property(nonatomic, strong) id<{{classPrefix}}ResponseDeserializer> responseDeserializer; @property(nonatomic, strong) id<{{classPrefix}}Sanitizer> sanitizer; @@ -48,13 +36,6 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; */ +(void)setCacheEnabled:(BOOL) enabled; -/** - * Gets the request queue size - * - * @return The size of `queuedRequests` static variable. - */ -+(NSUInteger)requestQueueSize; - /** * Sets the client unreachable * @@ -83,27 +64,6 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; */ +(AFNetworkReachabilityStatus) getReachabilityStatus; -/** - * Gets the next request id - * - * @return The next executed request id. - */ -+(NSNumber*) nextRequestId; - -/** - * Generates request id and add it to the queue - * - * @return The next executed request id. - */ -+(NSNumber*) queueRequest; - -/** - * Removes request id from the queue - * - * @param requestId The request which will be removed. - */ -+(void) cancelRequest:(NSNumber*)requestId; - /** * Customizes the behavior when the reachability changed * @@ -111,6 +71,11 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; */ +(void) setReachabilityChangeBlock:(void(^)(int))changeBlock; +/** + * Gets client singleton instance + */ ++ (instancetype) sharedClient; + /** * Sets the api client reachability strategy */ @@ -136,6 +101,14 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; queryParams:(NSDictionary **)querys WithAuthSettings:(NSArray *)authSettings; + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id<{{classPrefix}}Configuration>)configuration; + /** * Performs request * @@ -150,21 +123,21 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; * @param responseContentType Response content-type. * @param completionBlock The block will be executed when the request completed. * - * @return The request id. + * @return The created session task. */ --(NSNumber*) requestWithPath:(NSString*) path - method:(NSString*) method - pathParams:(NSDictionary *) pathParams - queryParams:(NSDictionary*) queryParams - formParams:(NSDictionary *) formParams - files:(NSDictionary *) files - body:(id) body - headerParams:(NSDictionary*) headerParams - authSettings:(NSArray *) authSettings - requestContentType:(NSString*) requestContentType - responseContentType:(NSString*) responseContentType - responseType:(NSString *) responseType - completionBlock:(void (^)(id, NSError *))completionBlock; +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; /** * Custom security policy @@ -173,12 +146,4 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; */ - (AFSecurityPolicy *) customSecurityPolicy; -/** - * {{classPrefix}}Configuration return sharedConfig - * - * @return {{classPrefix}}Configuration - */ -- ({{classPrefix}}Configuration*) configuration; - - @end diff --git a/modules/swagger-codegen/src/main/resources/objc/BasicAuthTokenProvider-body.mustache b/modules/swagger-codegen/src/main/resources/objc/BasicAuthTokenProvider-body.mustache new file mode 100644 index 000000000000..a928e5e8f4eb --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/BasicAuthTokenProvider-body.mustache @@ -0,0 +1,19 @@ +#import "{{classPrefix}}BasicAuthTokenProvider.h" + +@implementation {{classPrefix}}BasicAuthTokenProvider + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { + + // return empty string if username and password are empty + if (username.length == 0 && password.length == 0){ + return @""; + } + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; +} + +@end diff --git a/modules/swagger-codegen/src/main/resources/objc/BasicAuthTokenProvider-header.mustache b/modules/swagger-codegen/src/main/resources/objc/BasicAuthTokenProvider-header.mustache new file mode 100644 index 000000000000..dfb287568a08 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/BasicAuthTokenProvider-header.mustache @@ -0,0 +1,14 @@ +/** The `{{classPrefix}}BasicAuthTokenProvider` class creates a basic auth token from username and password. + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +#import + +@interface {{classPrefix}}BasicAuthTokenProvider : NSObject + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; + +@end \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/objc/Configuration-protocol.mustache b/modules/swagger-codegen/src/main/resources/objc/Configuration-protocol.mustache new file mode 100644 index 000000000000..db429a381505 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/Configuration-protocol.mustache @@ -0,0 +1,75 @@ +#import +#import "{{classPrefix}}Logger.h" + +{{>licenceInfo}} + +@protocol {{classPrefix}}Configuration + +/** + * Api logger + */ +@property (readonly, nonatomic) {{classPrefix}}Logger *logger; + +/** + * Base url + */ +@property (readonly, nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + */ +@property (readonly, nonatomic) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + */ +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (readonly, nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (readonly, nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (readonly, nonatomic) BOOL debug; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (readonly, nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (readonly, nonatomic) NSString *sslCaCert; + +/** + * Authentication Settings + */ +@property (readonly, nonatomic) NSDictionary *authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +@end \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/objc/Configuration-body.mustache b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-body.mustache similarity index 73% rename from modules/swagger-codegen/src/main/resources/objc/Configuration-body.mustache rename to modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-body.mustache index 1aeca25dd3e4..7c2b6cda20be 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Configuration-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-body.mustache @@ -1,6 +1,7 @@ -#import "{{classPrefix}}Configuration.h" +#import "{{classPrefix}}DefaultConfiguration.h" +#import "{{classPrefix}}BasicAuthTokenProvider.h" -@interface {{classPrefix}}Configuration () +@interface {{classPrefix}}DefaultConfiguration () @property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; @property (nonatomic, strong) NSMutableDictionary *mutableApiKey; @@ -8,12 +9,12 @@ @end -@implementation {{classPrefix}}Configuration +@implementation {{classPrefix}}DefaultConfiguration #pragma mark - Singleton Methods + (instancetype) sharedConfig { - static {{classPrefix}}Configuration *shardConfig = nil; + static {{classPrefix}}DefaultConfiguration *shardConfig = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ shardConfig = [[self alloc] init]; @@ -26,17 +27,16 @@ - (instancetype) init { self = [super init]; if (self) { - self.apiClient = nil; - self.host = @"{{basePath}}"; - self.username = @""; - self.password = @""; - self.accessToken= @""; - self.verifySSL = YES; - self.mutableApiKey = [NSMutableDictionary dictionary]; - self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; - self.mutableDefaultHeaders = [NSMutableDictionary dictionary]; - self.mutableDefaultHeaders[@"User-Agent"] = {{#httpUserAgent}}@"{{httpUserAgent}}"{{/httpUserAgent}}{{^httpUserAgent}}[NSString stringWithFormat:@"Swagger-Codegen/{{version}}/objc (%@; iOS %@; Scale/%0.2f)",[[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]]{{/httpUserAgent}}; - self.logger = [{{classPrefix}}Logger sharedLogger]; + _host = @"{{basePath}}"; + _username = @""; + _password = @""; + _accessToken= @""; + _verifySSL = YES; + _mutableApiKey = [NSMutableDictionary dictionary]; + _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + {{#httpUserAgent}}_mutableDefaultHeaders[@"User-Agent"] = @"{{httpUserAgent}}"{{/httpUserAgent}}; + _logger = [{{classPrefix}}Logger sharedLogger]; } return self; } @@ -58,16 +58,9 @@ } - (NSString *) getBasicAuthToken { - // return empty string if username and password are empty - if (self.username.length == 0 && self.password.length == 0){ - return @""; - } - NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password]; - NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; - basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; - - return basicAuthCredentials; + NSString *basicAuthToken = [{{classPrefix}}BasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; + return basicAuthToken; } - (NSString *) getAccessToken { diff --git a/modules/swagger-codegen/src/main/resources/objc/Configuration-header.mustache b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache similarity index 92% rename from modules/swagger-codegen/src/main/resources/objc/Configuration-header.mustache rename to modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache index e727942a4f28..f93c864ecfe2 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Configuration-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache @@ -1,23 +1,16 @@ #import -#import "{{classPrefix}}ApiClient.h" -#import "{{classPrefix}}Logger.h" +#import "{{classPrefix}}Configuration.h" {{>licenceInfo}} -@class {{classPrefix}}ApiClient; +@interface {{classPrefix}}DefaultConfiguration : NSObject <{{classPrefix}}Configuration> -@interface {{classPrefix}}Configuration : NSObject /** * Default api logger */ @property (nonatomic, strong) {{classPrefix}}Logger * logger; -/** - * Default api client - */ -@property (nonatomic) {{classPrefix}}ApiClient *apiClient; - /** * Default base url */ diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache index cec8bdeea271..b544a1dae58b 100644 --- a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache @@ -1,3 +1,4 @@ +#import #import "JSONValueTransformer+ISO8601.h" @implementation JSONValueTransformer (ISO8601) diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache index 2a8d5b0c9e7d..f621e7184a99 100644 --- a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache @@ -1,5 +1,4 @@ #import -#import #import {{>licenceInfo}} diff --git a/modules/swagger-codegen/src/main/resources/objc/Object-body.mustache b/modules/swagger-codegen/src/main/resources/objc/Object-body.mustache index b4599c34f3f1..88df6d6c9ae9 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Object-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/Object-body.mustache @@ -2,6 +2,35 @@ @implementation {{classPrefix}}Object +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + }); + + BOOL initSync; + @synchronized([self class]) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + /** * Gets the string presentation of the object. * This method will be called when logging model object using `NSLog`. diff --git a/modules/swagger-codegen/src/main/resources/objc/QueryParamCollection-body.mustache b/modules/swagger-codegen/src/main/resources/objc/QueryParamCollection-body.mustache index 23d0c8eaa861..b1c901dbffa1 100644 --- a/modules/swagger-codegen/src/main/resources/objc/QueryParamCollection-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/QueryParamCollection-body.mustache @@ -5,11 +5,15 @@ @synthesize values = _values; @synthesize format = _format; -- (id) initWithValuesAndFormat: (NSArray*) values - format: (NSString*) format { - _values = values; - _format = format; +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + self = [super init]; + if (self) { + _values = values; + _format = format; + } + return self; } diff --git a/modules/swagger-codegen/src/main/resources/objc/README.mustache b/modules/swagger-codegen/src/main/resources/objc/README.mustache index 4355ecc1af58..c6e9f2cc1d23 100644 --- a/modules/swagger-codegen/src/main/resources/objc/README.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/README.mustache @@ -45,7 +45,7 @@ Import the following: ```objc #import <{{podName}}/{{{classPrefix}}}ApiClient.h> -#import <{{podName}}/{{{classPrefix}}}Configuration.h> +#import <{{podName}}/{{{classPrefix}}}DefaultConfiguration.h> // load models {{#models}}{{#model}}#import <{{podName}}/{{{classname}}}.h> {{/model}}{{/models}}// load API classes for accessing endpoints @@ -64,7 +64,7 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} {{#hasAuthMethods}} -{{classPrefix}}Configuration *apiConfig = [{{classPrefix}}Configuration sharedConfig]; +{{classPrefix}}DefaultConfiguration *apiConfig = [{{classPrefix}}DefaultConfiguration sharedConfig]; {{#authMethods}}{{#isBasic}}// Configure HTTP basic authorization (authentication scheme: {{{name}}}) [apiConfig setUsername:@"YOUR_USERNAME"]; [apiConfig setPassword:@"YOUR_PASSWORD"]; diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache index 57fdc4ae6a75..505cfdd3c88a 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache @@ -7,7 +7,7 @@ @interface {{classname}} () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *defaultHeaders; @end @@ -21,19 +21,11 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - {{classPrefix}}Configuration *config = [{{classPrefix}}Configuration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[{{classPrefix}}ApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[{{classPrefix}}ApiClient sharedClient]]; } -- (id) initWithApiClient:({{classPrefix}}ApiClient *)apiClient { + +-(instancetype) initWithApiClient:({{classPrefix}}ApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; @@ -44,15 +36,6 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; #pragma mark - -+ (instancetype)sharedAPI { - static {{classname}} *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { return self.defaultHeaders[key]; } @@ -65,10 +48,6 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; [self.defaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [{{classPrefix}}ApiClient requestQueueSize]; -} - #pragma mark - Api Methods {{#operation}} @@ -79,7 +58,7 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; /// /// {{/allParams}} @returns {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} /// --(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} +-(NSURLSessionTask*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}} {{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler { {{#allParams}} @@ -175,8 +154,7 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; if(handler) { handler({{#returnType}}({{{ returnType }}})data, {{/returnType}}error); } - } - ]; + }]; } {{/operation}} diff --git a/modules/swagger-codegen/src/main/resources/objc/api-header.mustache b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache index abe4cf64eb03..266e7355fd62 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache @@ -11,7 +11,7 @@ extern NSString* k{{classname}}ErrorDomain; extern NSInteger k{{classname}}MissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:({{classPrefix}}ApiClient *)apiClient NS_DESIGNATED_INITIALIZER; {{#operations}} {{#operation}} @@ -23,7 +23,7 @@ extern NSInteger k{{classname}}MissingParamErrorCode; /// code:{{{code}}} message:"{{{message}}}"{{#hasMore}},{{/hasMore}}{{/responses}} /// /// @return {{{returnType}}} --(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} +-(NSURLSessionTask*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}} {{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler; diff --git a/modules/swagger-codegen/src/main/resources/objc/api-protocol.mustache b/modules/swagger-codegen/src/main/resources/objc/api-protocol.mustache index da87a712fa26..d8dadda1d0c0 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-protocol.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-protocol.mustache @@ -6,15 +6,13 @@ @protocol {{classPrefix}}Api -@property(nonatomic, assign) {{classPrefix}}ApiClient *apiClient; +@property(readonly, nonatomic, strong) {{classPrefix}}ApiClient *apiClient; --(id) initWithApiClient:({{classPrefix}}ApiClient *)apiClient; +-(instancetype) initWithApiClient:({{classPrefix}}ApiClient *)apiClient; -(void) addHeader:(NSString*)value forKey:(NSString*)key DEPRECATED_MSG_ATTRIBUTE("setDefaultHeaderValue:forKey:"); -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; -(NSString*) defaultHeaderForKey:(NSString*)key; --(NSUInteger) requestQueueSize; - @end diff --git a/modules/swagger-codegen/src/main/resources/objc/api_doc.mustache b/modules/swagger-codegen/src/main/resources/objc/api_doc.mustache index 44fe31d64045..b17c155b50e5 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api_doc.mustache @@ -12,7 +12,7 @@ Method | HTTP request | Description {{#operation}} # **{{{operationId}}}** ```objc --(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} +-(NSURLSessionTask*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}} {{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler; ``` @@ -24,7 +24,7 @@ Method | HTTP request | Description ### Example ```objc {{#hasAuthMethods}} -{{classPrefix}}Configuration *apiConfig = [{{classPrefix}}Configuration sharedConfig]; +{{classPrefix}}DefaultConfiguration *apiConfig = [{{classPrefix}}DefaultConfiguration sharedConfig]; {{#authMethods}}{{#isBasic}}// Configure HTTP basic authorization (authentication scheme: {{{name}}}) [apiConfig setUsername:@"YOUR_USERNAME"]; [apiConfig setPassword:@"YOUR_PASSWORD"]; diff --git a/modules/swagger-codegen/src/main/resources/objc/podspec.mustache b/modules/swagger-codegen/src/main/resources/objc/podspec.mustache index bd0bd9f328ee..7a2b22bea283 100644 --- a/modules/swagger-codegen/src/main/resources/objc/podspec.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/podspec.mustache @@ -32,6 +32,6 @@ Pod::Spec.new do |s| s.dependency 'AFNetworking', '~> 3' s.dependency 'JSONModel', '~> 1.2' - s.dependency 'ISO8601', '~> 0.5' + s.dependency 'ISO8601', '~> 0.6' end diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index 3fe81114d774..928576550bb0 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi - API version: 1.0.0 - Package version: -- Build date: 2016-07-19T16:53:26.476+08:00 +- Build date: 2016-08-04T12:24:23.866+02:00 - Build package: class io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -40,7 +40,7 @@ Import the following: ```objc #import -#import +#import // load models #import #import @@ -64,7 +64,7 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; @@ -124,12 +124,6 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## petstore_auth - **Type**: OAuth @@ -139,6 +133,12 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## Author diff --git a/samples/client/petstore/objc/core-data/SwaggerClient.podspec b/samples/client/petstore/objc/core-data/SwaggerClient.podspec index eab61d4dc328..fd785a6255c4 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient.podspec +++ b/samples/client/petstore/objc/core-data/SwaggerClient.podspec @@ -32,6 +32,6 @@ Pod::Spec.new do |s| s.dependency 'AFNetworking', '~> 3' s.dependency 'JSONModel', '~> 1.2' - s.dependency 'ISO8601', '~> 0.5' + s.dependency 'ISO8601', '~> 0.6' end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h index 97f914a627ef..ade955b27f80 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -32,7 +32,7 @@ extern NSString* kSWGPetApiErrorDomain; extern NSInteger kSWGPetApiMissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; /// Add a new pet to the store /// @@ -42,7 +42,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:405 message:"Invalid input" /// /// @return --(NSNumber*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -55,7 +55,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:400 message:"Invalid pet value" /// /// @return --(NSNumber*) deletePetWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler; @@ -69,7 +69,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:400 message:"Invalid status value" /// /// @return NSArray* --(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler; @@ -82,7 +82,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:400 message:"Invalid tag value" /// /// @return NSArray* --(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler; @@ -96,7 +96,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:404 message:"Pet not found" /// /// @return SWGPet* --(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; @@ -110,7 +110,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:405 message:"Validation exception" /// /// @return --(NSNumber*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -124,7 +124,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:405 message:"Invalid input" /// /// @return --(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler; @@ -140,7 +140,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) uploadFileWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index e35421fc5202..5551bffae9a8 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -5,7 +5,7 @@ @interface SWGPetApi () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *defaultHeaders; @end @@ -19,19 +19,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[SWGApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[SWGApiClient sharedClient]]; } -- (id) initWithApiClient:(SWGApiClient *)apiClient { + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; @@ -42,15 +34,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; #pragma mark - -+ (instancetype)sharedAPI { - static SWGPetApi *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { return self.defaultHeaders[key]; } @@ -63,10 +46,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; [self.defaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [SWGApiClient requestQueueSize]; -} - #pragma mark - Api Methods /// @@ -76,7 +55,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -124,8 +103,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -137,7 +115,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) deletePetWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'petId' is set @@ -202,8 +180,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -213,7 +190,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns NSArray* /// --(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; @@ -264,8 +241,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler((NSArray*)data, error); } - } - ]; + }]; } /// @@ -275,7 +251,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns NSArray* /// --(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; @@ -326,8 +302,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler((NSArray*)data, error); } - } - ]; + }]; } /// @@ -337,7 +312,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns SWGPet* /// --(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { // verify the required parameter 'petId' is set if (petId == nil) { @@ -376,7 +351,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"api_key", @"petstore_auth"]; + NSArray *authSettings = @[@"petstore_auth", @"api_key"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; @@ -398,8 +373,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler((SWGPet*)data, error); } - } - ]; + }]; } /// @@ -409,7 +383,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -457,8 +431,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -472,7 +445,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler { @@ -541,8 +514,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -556,7 +528,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) uploadFileWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file completionHandler: (void (^)(NSError* error)) handler { @@ -623,8 +595,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h index bbd588dba259..92aeefb176ed 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -32,7 +32,7 @@ extern NSString* kSWGStoreApiErrorDomain; extern NSInteger kSWGStoreApiMissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; /// Delete purchase order by ID /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -43,7 +43,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:404 message:"Order not found" /// /// @return --(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler; @@ -54,7 +54,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:200 message:"successful operation" /// /// @return NSDictionary* --(NSNumber*) getInventoryWithCompletionHandler: +-(NSURLSessionTask*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler; @@ -68,7 +68,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:404 message:"Order not found" /// /// @return SWGOrder* --(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; @@ -81,7 +81,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:400 message:"Invalid Order" /// /// @return SWGOrder* --(NSNumber*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m index e5964200f208..a275c1f0568f 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m @@ -5,7 +5,7 @@ @interface SWGStoreApi () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *defaultHeaders; @end @@ -19,19 +19,11 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[SWGApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[SWGApiClient sharedClient]]; } -- (id) initWithApiClient:(SWGApiClient *)apiClient { + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; @@ -42,15 +34,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; #pragma mark - -+ (instancetype)sharedAPI { - static SWGStoreApi *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { return self.defaultHeaders[key]; } @@ -63,10 +46,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; [self.defaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [SWGApiClient requestQueueSize]; -} - #pragma mark - Api Methods /// @@ -76,7 +55,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'orderId' is set if (orderId == nil) { @@ -137,8 +116,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -146,7 +124,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// Returns a map of status codes to quantities /// @returns NSDictionary* /// --(NSNumber*) getInventoryWithCompletionHandler: +-(NSURLSessionTask*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; @@ -193,8 +171,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; if(handler) { handler((NSDictionary*)data, error); } - } - ]; + }]; } /// @@ -204,7 +181,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// @returns SWGOrder* /// --(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { // verify the required parameter 'orderId' is set if (orderId == nil) { @@ -265,8 +242,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; if(handler) { handler((SWGOrder*)data, error); } - } - ]; + }]; } /// @@ -276,7 +252,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// @returns SWGOrder* /// --(NSNumber*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -324,8 +300,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; if(handler) { handler((SWGOrder*)data, error); } - } - ]; + }]; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h index 67f8ec9cbb21..2c35bdcb7b06 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -32,7 +32,7 @@ extern NSString* kSWGUserApiErrorDomain; extern NSInteger kSWGUserApiMissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; /// Create user /// This can only be done by the logged in user. @@ -42,7 +42,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; @@ -54,7 +54,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -66,7 +66,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -79,7 +79,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:404 message:"User not found" /// /// @return --(NSNumber*) deleteUserWithUsername: (NSString*) username +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler; @@ -93,7 +93,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:404 message:"User not found" /// /// @return SWGUser* --(NSNumber*) getUserByNameWithUsername: (NSString*) username +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; @@ -107,7 +107,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:400 message:"Invalid username/password supplied" /// /// @return NSString* --(NSNumber*) loginUserWithUsername: (NSString*) username +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler; @@ -119,7 +119,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) logoutUserWithCompletionHandler: +-(NSURLSessionTask*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler; @@ -133,7 +133,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:404 message:"User not found" /// /// @return --(NSNumber*) updateUserWithUsername: (NSString*) username +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m index 6ffb578ed76e..58e1729f4908 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m @@ -5,7 +5,7 @@ @interface SWGUserApi () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *defaultHeaders; @end @@ -19,19 +19,11 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[SWGApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[SWGApiClient sharedClient]]; } -- (id) initWithApiClient:(SWGApiClient *)apiClient { + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; @@ -42,15 +34,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; #pragma mark - -+ (instancetype)sharedAPI { - static SWGUserApi *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { return self.defaultHeaders[key]; } @@ -63,10 +46,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; [self.defaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [SWGApiClient requestQueueSize]; -} - #pragma mark - Api Methods /// @@ -76,7 +55,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -124,8 +103,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -135,7 +113,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -183,8 +161,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -194,7 +171,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -242,8 +219,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -253,7 +229,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) deleteUserWithUsername: (NSString*) username +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -314,8 +290,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -325,7 +300,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns SWGUser* /// --(NSNumber*) getUserByNameWithUsername: (NSString*) username +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -386,8 +361,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler((SWGUser*)data, error); } - } - ]; + }]; } /// @@ -399,7 +373,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns NSString* /// --(NSNumber*) loginUserWithUsername: (NSString*) username +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; @@ -453,8 +427,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler((NSString*)data, error); } - } - ]; + }]; } /// @@ -462,7 +435,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) logoutUserWithCompletionHandler: +-(NSURLSessionTask*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; @@ -509,8 +482,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -522,7 +494,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) updateUserWithUsername: (NSString*) username +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set @@ -585,8 +557,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index dd8e721b3b91..ace66ba3146b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -1,5 +1,4 @@ #import -#import #import /** diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m index cec8bdeea271..b544a1dae58b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -1,3 +1,4 @@ +#import #import "JSONValueTransformer+ISO8601.h" @implementation JSONValueTransformer (ISO8601) diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h index 93b564be3d12..c02d289a336f 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h @@ -28,15 +28,13 @@ @protocol SWGApi -@property(nonatomic, assign) SWGApiClient *apiClient; +@property(readonly, nonatomic, strong) SWGApiClient *apiClient; --(id) initWithApiClient:(SWGApiClient *)apiClient; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; -(void) addHeader:(NSString*)value forKey:(NSString*)key DEPRECATED_MSG_ATTRIBUTE("setDefaultHeaderValue:forKey:"); -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; -(NSString*) defaultHeaderForKey:(NSString*)key; --(NSUInteger) requestQueueSize; - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h index 2ec5c9b0fcc4..4f7a6fda11a4 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h @@ -1,13 +1,7 @@ -#import -#import #import -#import "SWGJSONResponseSerializer.h" -#import "SWGJSONRequestSerializer.h" -#import "SWGQueryParamCollection.h" #import "SWGConfiguration.h" #import "SWGResponseDeserializer.h" #import "SWGSanitizer.h" -#import "SWGLogger.h" /** * Swagger Petstore @@ -33,16 +27,6 @@ * limitations under the License. */ -#import "SWGCategory.h" -#import "SWGOrder.h" -#import "SWGPet.h" -#import "SWGTag.h" -#import "SWGUser.h" - - - -@class SWGConfiguration; - /** * A key for `NSError` user info dictionaries. * @@ -50,15 +34,15 @@ */ extern NSString *const SWGResponseObjectErrorKey; + @interface SWGApiClient : AFHTTPSessionManager +@property (nonatomic, strong, readonly) id configuration; + @property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy; @property(nonatomic, assign) NSTimeInterval timeoutInterval; @property(nonatomic, readonly) NSOperationQueue* queue; -/// In order to ensure the HTTPResponseHeaders are correct, it is recommended to initialize one SWGApiClient instance per thread. -@property(nonatomic, readonly) NSDictionary* HTTPResponseHeaders; - @property(nonatomic, strong) id responseDeserializer; @property(nonatomic, strong) id sanitizer; @@ -74,13 +58,6 @@ extern NSString *const SWGResponseObjectErrorKey; */ +(void)setCacheEnabled:(BOOL) enabled; -/** - * Gets the request queue size - * - * @return The size of `queuedRequests` static variable. - */ -+(NSUInteger)requestQueueSize; - /** * Sets the client unreachable * @@ -109,27 +86,6 @@ extern NSString *const SWGResponseObjectErrorKey; */ +(AFNetworkReachabilityStatus) getReachabilityStatus; -/** - * Gets the next request id - * - * @return The next executed request id. - */ -+(NSNumber*) nextRequestId; - -/** - * Generates request id and add it to the queue - * - * @return The next executed request id. - */ -+(NSNumber*) queueRequest; - -/** - * Removes request id from the queue - * - * @param requestId The request which will be removed. - */ -+(void) cancelRequest:(NSNumber*)requestId; - /** * Customizes the behavior when the reachability changed * @@ -137,6 +93,11 @@ extern NSString *const SWGResponseObjectErrorKey; */ +(void) setReachabilityChangeBlock:(void(^)(int))changeBlock; +/** + * Gets client singleton instance + */ ++ (instancetype) sharedClient; + /** * Sets the api client reachability strategy */ @@ -162,6 +123,14 @@ extern NSString *const SWGResponseObjectErrorKey; queryParams:(NSDictionary **)querys WithAuthSettings:(NSArray *)authSettings; + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + /** * Performs request * @@ -176,21 +145,21 @@ extern NSString *const SWGResponseObjectErrorKey; * @param responseContentType Response content-type. * @param completionBlock The block will be executed when the request completed. * - * @return The request id. + * @return The created session task. */ --(NSNumber*) requestWithPath:(NSString*) path - method:(NSString*) method - pathParams:(NSDictionary *) pathParams - queryParams:(NSDictionary*) queryParams - formParams:(NSDictionary *) formParams - files:(NSDictionary *) files - body:(id) body - headerParams:(NSDictionary*) headerParams - authSettings:(NSArray *) authSettings - requestContentType:(NSString*) requestContentType - responseContentType:(NSString*) responseContentType - responseType:(NSString *) responseType - completionBlock:(void (^)(id, NSError *))completionBlock; +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; /** * Custom security policy @@ -199,12 +168,4 @@ extern NSString *const SWGResponseObjectErrorKey; */ - (AFSecurityPolicy *) customSecurityPolicy; -/** - * SWGConfiguration return sharedConfig - * - * @return SWGConfiguration - */ -- (SWGConfiguration*) configuration; - - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m index f004200b2eb8..d4758d36b03a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m @@ -1,10 +1,16 @@ +#import + #import "SWGApiClient.h" +#import "SWGJSONRequestSerializer.h" +#import "SWGJSONResponseSerializer.h" +#import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" + + NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; -static NSUInteger requestId = 0; static bool offlineState = false; -static NSMutableSet * queuedRequests = nil; static bool cacheEnabled = false; static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable; static void (^reachabilityChangeBlock)(int); @@ -36,38 +42,61 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { @interface SWGApiClient () -@property (nonatomic, strong) NSDictionary* HTTPResponseHeaders; +@property (nonatomic, strong, readwrite) id configuration; @end @implementation SWGApiClient +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static SWGApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + - (instancetype)init { - NSString *baseUrl = [[SWGConfiguration sharedConfig] host]; - return [self initWithBaseURL:[NSURL URLWithString:baseUrl]]; + + return [self initWithConfiguration:[SWGDefaultConfiguration sharedConfig]]; } - (instancetype)initWithBaseURL:(NSURL *)url { + + return [self initWithBaseURL:url + configuration:[SWGDefaultConfiguration sharedConfig]]; + +} + +- (instancetype)initWithConfiguration:(id)configuration { + + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url + configuration:(id)configuration { + self = [super initWithBaseURL:url]; if (self) { - self.timeoutInterval = 60; + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[SWGResponseDeserializer alloc] init]; + _sanitizer = [[SWGSanitizer alloc] init]; + self.requestSerializer = [AFJSONRequestSerializer serializer]; self.responseSerializer = [AFJSONResponseSerializer serializer]; self.securityPolicy = [self customSecurityPolicy]; - self.responseDeserializer = [[SWGResponseDeserializer alloc] init]; - self.sanitizer = [[SWGSanitizer alloc] init]; + // configure reachability [self configureCacheReachibility]; } - return self; -} -+ (void)initialize { - if (self == [SWGApiClient class]) { - queuedRequests = [[NSMutableSet alloc] init]; - // initialize URL cache - [self configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024]; - } + return self; } #pragma mark - Setter Methods @@ -113,43 +142,6 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [NSURLCache setSharedURLCache:cache]; } -#pragma mark - Request Methods - -+(NSUInteger)requestQueueSize { - return [queuedRequests count]; -} - -+(NSNumber*) nextRequestId { - @synchronized(self) { - return @(++requestId); - } -} - -+(NSNumber*) queueRequest { - NSNumber* requestId = [[self class] nextRequestId]; - SWGDebugLog(@"added %@ to request queue", requestId); - [queuedRequests addObject:requestId]; - return requestId; -} - -+(void) cancelRequest:(NSNumber*)requestId { - [queuedRequests removeObject:requestId]; -} - --(Boolean) executeRequestWithId:(NSNumber*) requestId { - NSSet* matchingItems = [queuedRequests objectsPassingTest:^BOOL(id obj, BOOL *stop) { - return [obj intValue] == [requestId intValue]; - }]; - - if (matchingItems.count == 1) { - SWGDebugLog(@"removed request id %@", requestId); - [queuedRequests removeObject:requestId]; - return YES; - } else { - return NO; - } -} - #pragma mark - Reachability Methods +(AFNetworkReachabilityStatus) getReachabilityStatus { @@ -179,23 +171,19 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [self.reachabilityManager startMonitoring]; } -#pragma mark - Operation Methods +#pragma mark - Task Methods -- (void) operationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request + completionBlock: (void (^)(id, NSError *))completionBlock { + + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { SWGDebugLogResponse(response, responseObject,request,error); - strongSelf.HTTPResponseHeaders = SWG__headerFieldsForResponse(response); + if(!error) { completionBlock(responseObject, nil); return; } + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; if (responseObject) { // Add in the (parsed) response body. @@ -204,20 +192,18 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - [op resume]; + + return task; } -- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } - strongSelf.HTTPResponseHeaders = SWG__headerFieldsForResponse(response); +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request + completionBlock: (void (^)(id, NSError *))completionBlock { + + id config = self.configuration; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { SWGDebugLogResponse(response, responseObject,request,error); + if(error) { NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; if (responseObject) { @@ -226,8 +212,9 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); } - NSString *directory = [self configuration].tempFolderPath ?: NSTemporaryDirectory(); - NSString * filename = SWG__fileNameForResponse(response); + + NSString *directory = config.tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = SWG__fileNameForResponse(response); NSString *filepath = [directory stringByAppendingPathComponent:filename]; NSURL *file = [NSURL fileURLWithPath:filepath]; @@ -236,24 +223,26 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(file, nil); }]; - [op resume]; + + return task; } -#pragma mark - Perform Request Methods +#pragma mark - Perform Request Methods + +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { --(NSNumber*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock { // setting request serializer if ([requestContentType isEqualToString:@"application/json"]) { self.requestSerializer = [SWGJSONRequestSerializer serializer]; @@ -359,14 +348,16 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [self postProcessRequest:request]; - NSNumber* requestId = [SWGApiClient queueRequest]; + + NSURLSessionTask *task = nil; + if ([responseType isEqualToString:@"NSURL*"] || [responseType isEqualToString:@"NSURL"]) { - [self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { completionBlock(data, error); }]; } else { - [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { NSError * serializationError; id response = [self.responseDeserializer deserialize:data class:responseType error:&serializationError]; if(!response && !error){ @@ -375,7 +366,10 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(response, error); }]; } - return requestId; + + [task resume]; + + return task; } //Added for easier override to modify request @@ -455,10 +449,11 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - - NSDictionary* configurationAuthSettings = [[self configuration] authSettings]; + + id config = self.configuration; for (NSString *auth in authSettings) { - NSDictionary *authSetting = configurationAuthSettings[auth]; + NSDictionary *authSetting = config.authSettings[auth]; + if(!authSetting) { // auth setting is set only if the key is non-empty continue; } @@ -479,11 +474,11 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { - (AFSecurityPolicy *) customSecurityPolicy { AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - SWGConfiguration *config = [self configuration]; + id config = self.configuration; if (config.sslCaCert) { NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; - [securityPolicy setPinnedCertificates:@[certData]]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; } if (config.verifySSL) { @@ -497,8 +492,4 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { return securityPolicy; } -- (SWGConfiguration*) configuration { - return [SWGConfiguration sharedConfig]; -} - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h new file mode 100644 index 000000000000..6c50d3750b4a --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h @@ -0,0 +1,14 @@ +/** The `SWGBasicAuthTokenProvider` class creates a basic auth token from username and password. + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +#import + +@interface SWGBasicAuthTokenProvider : NSObject + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; + +@end \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m new file mode 100644 index 000000000000..3788009ec587 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m @@ -0,0 +1,19 @@ +#import "SWGBasicAuthTokenProvider.h" + +@implementation SWGBasicAuthTokenProvider + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { + + // return empty string if username and password are empty + if (username.length == 0 && password.length == 0){ + return @""; + } + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h index b6c37405ca2f..a85a47d4bc8f 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h @@ -1,5 +1,4 @@ #import -#import "SWGApiClient.h" #import "SWGLogger.h" /** @@ -26,157 +25,73 @@ * limitations under the License. */ -@class SWGApiClient; - -@interface SWGConfiguration : NSObject +@protocol SWGConfiguration /** - * Default api logger + * Api logger */ -@property (nonatomic, strong) SWGLogger * logger; +@property (readonly, nonatomic) SWGLogger *logger; /** - * Default api client + * Base url */ -@property (nonatomic) SWGApiClient *apiClient; - -/** - * Default base url - */ -@property (nonatomic) NSString *host; +@property (readonly, nonatomic) NSString *host; /** * Api key values for Api Key type Authentication - * - * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. */ -@property (readonly, nonatomic, strong) NSDictionary *apiKey; +@property (readonly, nonatomic) NSDictionary *apiKey; /** * Api key prefix values to be prepend to the respective api key - * - * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. */ -@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; /** * Username for HTTP Basic Authentication */ - @property (nonatomic) NSString *username; +@property (readonly, nonatomic) NSString *username; /** * Password for HTTP Basic Authentication */ -@property (nonatomic) NSString *password; +@property (readonly, nonatomic) NSString *password; /** * Access token for OAuth */ -@property (nonatomic) NSString *accessToken; +@property (readonly, nonatomic) NSString *accessToken; /** * Temp folder for file download */ -@property (nonatomic) NSString *tempFolderPath; +@property (readonly, nonatomic) NSString *tempFolderPath; /** * Debug switch, default false */ -@property (nonatomic) BOOL debug; - -/** - * Gets configuration singleton instance - */ -+ (instancetype) sharedConfig; +@property (readonly, nonatomic) BOOL debug; /** * SSL/TLS verification * Set this to NO to skip verifying SSL certificate when calling API from https server */ -@property (nonatomic) BOOL verifySSL; +@property (readonly, nonatomic) BOOL verifySSL; /** * SSL/TLS verification * Set this to customize the certificate file to verify the peer */ -@property (nonatomic) NSString *sslCaCert; +@property (readonly, nonatomic) NSString *sslCaCert; /** - * Sets API key - * - * To remove a apiKey for an identifier, just set the apiKey to nil. - * - * @param apiKey API key or token. - * @param identifier API key identifier (authentication schema). - * + * Authentication Settings */ -- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; - -/** - * Removes api key - * - * @param identifier API key identifier. - */ -- (void) removeApiKey:(NSString *)identifier; - -/** - * Sets the prefix for API key - * - * @param apiKeyPrefix API key prefix. - * @param identifier API key identifier. - */ -- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; - -/** - * Removes api key prefix - * - * @param identifier API key identifier. - */ -- (void) removeApiKeyPrefix:(NSString *)identifier; - -/** - * Gets API key (with prefix if set) - */ -- (NSString *) getApiKeyWithPrefix:(NSString *) key; - -/** - * Gets Basic Auth token - */ -- (NSString *) getBasicAuthToken; - -/** - * Gets OAuth access token - */ -- (NSString *) getAccessToken; - -/** - * Gets Authentication Settings - */ -- (NSDictionary *) authSettings; +@property (readonly, nonatomic) NSDictionary *authSettings; /** * Default headers for all services */ @property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; -/** -* Removes header from defaultHeaders -* -* @param Header name. -*/ --(void) removeDefaultHeaderForKey:(NSString*)key; - -/** -* Sets the header for key -* -* @param value Value for header name -* @param key Header name -*/ --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; - -/** -* @param Header key name. -*/ --(NSString*) defaultHeaderForKey:(NSString*)key; - -@end +@end \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h new file mode 100644 index 000000000000..cd44d30e551c --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -0,0 +1,175 @@ +#import +#import "SWGConfiguration.h" + +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +@interface SWGDefaultConfiguration : NSObject + + +/** + * Default api logger + */ +@property (nonatomic, strong) SWGLogger * logger; + +/** + * Default base url + */ +@property (nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ + @property (nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (nonatomic) BOOL debug; + +/** + * Gets configuration singleton instance + */ ++ (instancetype) sharedConfig; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (nonatomic) NSString *sslCaCert; + +/** + * Sets API key + * + * To remove a apiKey for an identifier, just set the apiKey to nil. + * + * @param apiKey API key or token. + * @param identifier API key identifier (authentication schema). + * + */ +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; + +/** + * Removes api key + * + * @param identifier API key identifier. + */ +- (void) removeApiKey:(NSString *)identifier; + +/** + * Sets the prefix for API key + * + * @param apiKeyPrefix API key prefix. + * @param identifier API key identifier. + */ +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; + +/** + * Removes api key prefix + * + * @param identifier API key identifier. + */ +- (void) removeApiKeyPrefix:(NSString *)identifier; + +/** + * Gets API key (with prefix if set) + */ +- (NSString *) getApiKeyWithPrefix:(NSString *) key; + +/** + * Gets Basic Auth token + */ +- (NSString *) getBasicAuthToken; + +/** + * Gets OAuth access token + */ +- (NSString *) getAccessToken; + +/** + * Gets Authentication Settings + */ +- (NSDictionary *) authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +/** +* Removes header from defaultHeaders +* +* @param Header name. +*/ +-(void) removeDefaultHeaderForKey:(NSString*)key; + +/** +* Sets the header for key +* +* @param value Value for header name +* @param key Header name +*/ +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; + +/** +* @param Header key name. +*/ +-(NSString*) defaultHeaderForKey:(NSString*)key; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m similarity index 72% rename from samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.m rename to samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m index b21290068a1c..cd37ae358590 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m @@ -1,6 +1,7 @@ -#import "SWGConfiguration.h" +#import "SWGDefaultConfiguration.h" +#import "SWGBasicAuthTokenProvider.h" -@interface SWGConfiguration () +@interface SWGDefaultConfiguration () @property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; @property (nonatomic, strong) NSMutableDictionary *mutableApiKey; @@ -8,12 +9,12 @@ @end -@implementation SWGConfiguration +@implementation SWGDefaultConfiguration #pragma mark - Singleton Methods + (instancetype) sharedConfig { - static SWGConfiguration *shardConfig = nil; + static SWGDefaultConfiguration *shardConfig = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ shardConfig = [[self alloc] init]; @@ -26,17 +27,16 @@ - (instancetype) init { self = [super init]; if (self) { - self.apiClient = nil; - self.host = @"http://petstore.swagger.io/v2"; - self.username = @""; - self.password = @""; - self.accessToken= @""; - self.verifySSL = YES; - self.mutableApiKey = [NSMutableDictionary dictionary]; - self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; - self.mutableDefaultHeaders = [NSMutableDictionary dictionary]; - self.mutableDefaultHeaders[@"User-Agent"] = [NSString stringWithFormat:@"Swagger-Codegen/1.0.0/objc (%@; iOS %@; Scale/%0.2f)",[[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]]; - self.logger = [SWGLogger sharedLogger]; + _host = @"http://petstore.swagger.io/v2"; + _username = @""; + _password = @""; + _accessToken= @""; + _verifySSL = YES; + _mutableApiKey = [NSMutableDictionary dictionary]; + _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + ; + _logger = [SWGLogger sharedLogger]; } return self; } @@ -58,16 +58,9 @@ } - (NSString *) getBasicAuthToken { - // return empty string if username and password are empty - if (self.username.length == 0 && self.password.length == 0){ - return @""; - } - NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password]; - NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; - basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; - - return basicAuthCredentials; + NSString *basicAuthToken = [SWGBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; + return basicAuthToken; } - (NSString *) getAccessToken { @@ -110,13 +103,6 @@ - (NSDictionary *) authSettings { return @{ - @"api_key": - @{ - @"type": @"api_key", - @"in": @"header", - @"key": @"api_key", - @"value": [self getApiKeyWithPrefix:@"api_key"] - }, @"petstore_auth": @{ @"type": @"oauth", @@ -124,6 +110,13 @@ @"key": @"Authorization", @"value": [self getAccessToken] }, + @"api_key": + @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"api_key", + @"value": [self getApiKeyWithPrefix:@"api_key"] + }, }; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m index 8085c404f7e2..db970d34669b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m @@ -2,6 +2,35 @@ @implementation SWGObject +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + }); + + BOOL initSync; + @synchronized([self class]) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + /** * Gets the string presentation of the object. * This method will be called when logging model object using `NSLog`. diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m index 833030451853..9aa8a091762d 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m @@ -5,11 +5,15 @@ @synthesize values = _values; @synthesize format = _format; -- (id) initWithValuesAndFormat: (NSArray*) values - format: (NSString*) format { - _values = values; - _format = format; +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + self = [super init]; + if (self) { + _values = values; + _format = format; + } + return self; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 68c3e696436d..bbdc648f467d 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -1,621 +1,1440 @@ -// !$*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 */; }; - 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 */; }; - 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; }; - B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */; }; - B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC7027D4B025ABCA7999F /* Main.storyboard */; }; - B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC65E342ADA697322D68C /* Images.xcassets */; }; - B2ADC3C7634D15595DD14814 /* BuildersTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */; }; - B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */; }; -/* 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 = ""; }; - 4CCE21315897B7D544C83242 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 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 = ""; }; - 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = ""; }; - 6003F59C195388D20070C39A /* SWGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGAppDelegate.h; sourceTree = ""; }; - 6003F59D195388D20070C39A /* SWGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGAppDelegate.m; sourceTree = ""; }; - 6003F5A5195388D20070C39A /* SWGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGViewController.h; sourceTree = ""; }; - 6003F5A6195388D20070C39A /* SWGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGViewController.m; sourceTree = ""; }; - 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 = ""; }; - 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; - 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 = ""; }; - 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "SwaggerClient/Launch Screen.storyboard"; sourceTree = ""; }; - B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseHelper.h; sourceTree = ""; }; - B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatabaseHelper.m; sourceTree = ""; }; - B2ADC65E342ADA697322D68C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwaggerClient/Images.xcassets; sourceTree = ""; }; - B2ADC7027D4B025ABCA7999F /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Main.storyboard; path = SwaggerClient/Main.storyboard; sourceTree = ""; }; - B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuildersTest.m; sourceTree = ""; }; - 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 = ""; }; - 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 = ""; }; - E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwaggerClient.podspec; path = ../SwaggerClient.podspec; sourceTree = ""; }; - 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 = ""; - }; - 6003F58B195388D20070C39A /* Products */ = { - isa = PBXGroup; - children = ( - 6003F58A195388D20070C39A /* SwaggerClient_Example.app */, - 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */, - B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */, - ); - name = Products; - sourceTree = ""; - }; - 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 = ""; - }; - 6003F593195388D20070C39A /* Example for SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6003F59C195388D20070C39A /* SWGAppDelegate.h */, - 6003F59D195388D20070C39A /* SWGAppDelegate.m */, - 6003F5A5195388D20070C39A /* SWGViewController.h */, - 6003F5A6195388D20070C39A /* SWGViewController.m */, - 6003F594195388D20070C39A /* Supporting Files */, - ); - name = "Example for SwaggerClient"; - path = SwaggerClient; - sourceTree = ""; - }; - 6003F594195388D20070C39A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6003F595195388D20070C39A /* SwaggerClient-Info.plist */, - 6003F596195388D20070C39A /* InfoPlist.strings */, - 6003F599195388D20070C39A /* main.m */, - 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 6003F5B5195388D20070C39A /* Tests */ = { - isa = PBXGroup; - children = ( - 6003F5B6195388D20070C39A /* Supporting Files */, - B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */, - B2ADCA62DE4AC0F5BAB42208 /* Helpers */, - ); - path = Tests; - sourceTree = ""; - }; - 6003F5B6195388D20070C39A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6003F5B7195388D20070C39A /* Tests-Info.plist */, - 6003F5B8195388D20070C39A /* InfoPlist.strings */, - 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { - isa = PBXGroup; - children = ( - E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */, - 4CCE21315897B7D544C83242 /* README.md */, - B2ADC7027D4B025ABCA7999F /* Main.storyboard */, - B2ADC65E342ADA697322D68C /* Images.xcassets */, - ); - name = "Podspec Metadata"; - sourceTree = ""; - }; - B2ADCA62DE4AC0F5BAB42208 /* Helpers */ = { - isa = PBXGroup; - children = ( - B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */, - B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */, - ); - path = Helpers; - sourceTree = ""; - }; - 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 = ""; - }; -/* 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 */, - 183E54C09C54DAEB54B2546F /* 📦 Embed Pods Frameworks */, - ); - 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 */, - 111D7956304BD6E860AA8709 /* 📦 Embed Pods Frameworks */, - ); - 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 = ( - 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, - B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */, - B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */, - B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6003F5AC195388D20070C39A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 111D7956304BD6E860AA8709 /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 183E54C09C54DAEB54B2546F /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 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 = ( - B2ADC3C7634D15595DD14814 /* BuildersTest.m in Sources */, - B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.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 = ""; - }; - 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 6003F5B9195388D20070C39A /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* 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 */; -} + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 111D7956304BD6E860AA8709 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh" + + showEnvVarsInLog + 0 + + 158CE3AA214CB1B31C7ADC48 + + fileRef + FDEF5BA3CF9CFFDEB5A47DB4 + isa + PBXBuildFile + + 183E54C09C54DAEB54B2546F + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-frameworks.sh" + + showEnvVarsInLog + 0 + + 1A81C3BE3E54961CD827EAE3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-SwaggerClient_Tests.release.xcconfig + path + Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.release.xcconfig + sourceTree + <group> + + 429AF5C69E165ED75311B4B0 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh" + + showEnvVarsInLog + 0 + + 4CCE21315897B7D544C83242 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + net.daringfireball.markdown + name + README.md + path + ../README.md + sourceTree + <group> + + 6003F581195388D10070C39A + + children + + 60FF7A9C1954A5C5007DD14C + 6003F593195388D20070C39A + 6003F5B5195388D20070C39A + 6003F58C195388D20070C39A + 6003F58B195388D20070C39A + CCE77F10C6D41F74B075ECD0 + + isa + PBXGroup + sourceTree + <group> + + 6003F582195388D10070C39A + + attributes + + CLASSPREFIX + SWG + LastUpgradeCheck + 0510 + ORGANIZATIONNAME + geekerzp + + buildConfigurationList + 6003F585195388D10070C39A + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 6003F581195388D10070C39A + productRefGroup + 6003F58B195388D20070C39A + projectDirPath + + projectReferences + + projectRoot + + targets + + 6003F589195388D20070C39A + 6003F5AD195388D20070C39A + + + 6003F585195388D10070C39A + + buildConfigurations + + 6003F5BD195388D20070C39A + 6003F5BE195388D20070C39A + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 6003F586195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F59E195388D20070C39A + 6003F5A7195388D20070C39A + 6003F59A195388D20070C39A + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F587195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F590195388D20070C39A + 6003F592195388D20070C39A + 6003F58E195388D20070C39A + 94BE6BE84795B5034A811E61 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F588195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F598195388D20070C39A + B2ADC17C287DCABF329BA8AC + B2ADC2D632658A5F73C6CE66 + B2ADC56977372855A63F4E4D + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F589195388D20070C39A + + buildConfigurationList + 6003F5BF195388D20070C39A + buildPhases + + 799E7E29D924C30424DFBA28 + 6003F586195388D20070C39A + 6003F587195388D20070C39A + 6003F588195388D20070C39A + 429AF5C69E165ED75311B4B0 + 183E54C09C54DAEB54B2546F + FF3F107CF27E0A54D86C49F5 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + SwaggerClient_Example + productName + SwaggerClient + productReference + 6003F58A195388D20070C39A + productType + com.apple.product-type.application + + 6003F58A195388D20070C39A + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + SwaggerClient_Example.app + sourceTree + BUILT_PRODUCTS_DIR + + 6003F58B195388D20070C39A + + children + + 6003F58A195388D20070C39A + 6003F5AE195388D20070C39A + B2ADC084A2C0BDF217832B03 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 6003F58C195388D20070C39A + + children + + 6003F58D195388D20070C39A + 6003F58F195388D20070C39A + 6003F591195388D20070C39A + 6003F5AF195388D20070C39A + 8D46325ECAD48245C07F6733 + FDEF5BA3CF9CFFDEB5A47DB4 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 6003F58D195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + Foundation.framework + path + System/Library/Frameworks/Foundation.framework + sourceTree + SDKROOT + + 6003F58E195388D20070C39A + + fileRef + 6003F58D195388D20070C39A + isa + PBXBuildFile + + 6003F58F195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + CoreGraphics.framework + path + System/Library/Frameworks/CoreGraphics.framework + sourceTree + SDKROOT + + 6003F590195388D20070C39A + + fileRef + 6003F58F195388D20070C39A + isa + PBXBuildFile + + 6003F591195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + UIKit.framework + path + System/Library/Frameworks/UIKit.framework + sourceTree + SDKROOT + + 6003F592195388D20070C39A + + fileRef + 6003F591195388D20070C39A + isa + PBXBuildFile + + 6003F593195388D20070C39A + + children + + 6003F59C195388D20070C39A + 6003F59D195388D20070C39A + 6003F5A5195388D20070C39A + 6003F5A6195388D20070C39A + 6003F594195388D20070C39A + + isa + PBXGroup + name + Example for SwaggerClient + path + SwaggerClient + sourceTree + <group> + + 6003F594195388D20070C39A + + children + + 6003F595195388D20070C39A + 6003F596195388D20070C39A + 6003F599195388D20070C39A + 6003F59B195388D20070C39A + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 6003F595195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + SwaggerClient-Info.plist + sourceTree + <group> + + 6003F596195388D20070C39A + + children + + 6003F597195388D20070C39A + + isa + PBXVariantGroup + name + InfoPlist.strings + sourceTree + <group> + + 6003F597195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + text.plist.strings + name + en + path + en.lproj/InfoPlist.strings + sourceTree + <group> + + 6003F598195388D20070C39A + + fileRef + 6003F596195388D20070C39A + isa + PBXBuildFile + + 6003F599195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 6003F59A195388D20070C39A + + fileRef + 6003F599195388D20070C39A + isa + PBXBuildFile + + 6003F59B195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SwaggerClient-Prefix.pch + sourceTree + <group> + + 6003F59C195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SWGAppDelegate.h + sourceTree + <group> + + 6003F59D195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SWGAppDelegate.m + sourceTree + <group> + + 6003F59E195388D20070C39A + + fileRef + 6003F59D195388D20070C39A + isa + PBXBuildFile + + 6003F5A5195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SWGViewController.h + sourceTree + <group> + + 6003F5A6195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SWGViewController.m + sourceTree + <group> + + 6003F5A7195388D20070C39A + + fileRef + 6003F5A6195388D20070C39A + isa + PBXBuildFile + + 6003F5AA195388D20070C39A + + buildActionMask + 2147483647 + files + + B2ADC3C7634D15595DD14814 + B2ADC0B1C8A60A05C48B4DF7 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F5AB195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F5B0195388D20070C39A + 6003F5B2195388D20070C39A + 6003F5B1195388D20070C39A + 158CE3AA214CB1B31C7ADC48 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F5AC195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F5BA195388D20070C39A + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F5AD195388D20070C39A + + buildConfigurationList + 6003F5C2195388D20070C39A + buildPhases + + 7B069562A9F91E498732474F + 6003F5AA195388D20070C39A + 6003F5AB195388D20070C39A + 6003F5AC195388D20070C39A + E337D7E459CCFFDF27046FFC + 111D7956304BD6E860AA8709 + AA7CAD658C61D6EBA222B5F8 + + buildRules + + dependencies + + 6003F5B4195388D20070C39A + + isa + PBXNativeTarget + name + SwaggerClient_Tests + productName + SwaggerClientTests + productReference + 6003F5AE195388D20070C39A + productType + com.apple.product-type.bundle.unit-test + + 6003F5AE195388D20070C39A + + explicitFileType + wrapper.cfbundle + includeInIndex + 0 + isa + PBXFileReference + path + SwaggerClient_Tests.xctest + sourceTree + BUILT_PRODUCTS_DIR + + 6003F5AF195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + XCTest.framework + path + Library/Frameworks/XCTest.framework + sourceTree + DEVELOPER_DIR + + 6003F5B0195388D20070C39A + + fileRef + 6003F5AF195388D20070C39A + isa + PBXBuildFile + + 6003F5B1195388D20070C39A + + fileRef + 6003F58D195388D20070C39A + isa + PBXBuildFile + + 6003F5B2195388D20070C39A + + fileRef + 6003F591195388D20070C39A + isa + PBXBuildFile + + 6003F5B3195388D20070C39A + + containerPortal + 6003F582195388D10070C39A + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 6003F589195388D20070C39A + remoteInfo + SwaggerClient + + 6003F5B4195388D20070C39A + + isa + PBXTargetDependency + target + 6003F589195388D20070C39A + targetProxy + 6003F5B3195388D20070C39A + + 6003F5B5195388D20070C39A + + children + + 6003F5B6195388D20070C39A + B2ADC838FCC22F4BC6C41106 + B2ADCA62DE4AC0F5BAB42208 + + isa + PBXGroup + path + Tests + sourceTree + <group> + + 6003F5B6195388D20070C39A + + children + + 6003F5B7195388D20070C39A + 6003F5B8195388D20070C39A + 606FC2411953D9B200FFA9A0 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 6003F5B7195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Tests-Info.plist + sourceTree + <group> + + 6003F5B8195388D20070C39A + + children + + 6003F5B9195388D20070C39A + + isa + PBXVariantGroup + name + InfoPlist.strings + sourceTree + <group> + + 6003F5B9195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + text.plist.strings + name + en + path + en.lproj/InfoPlist.strings + sourceTree + <group> + + 6003F5BA195388D20070C39A + + fileRef + 6003F5B8195388D20070C39A + isa + PBXBuildFile + + 6003F5BD195388D20070C39A + + 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 + + isa + XCBuildConfiguration + name + Debug + + 6003F5BE195388D20070C39A + + 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 + + isa + XCBuildConfiguration + name + Release + + 6003F5BF195388D20070C39A + + buildConfigurations + + 6003F5C0195388D20070C39A + 6003F5C1195388D20070C39A + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 6003F5C0195388D20070C39A + + baseConfigurationReference + E445A633FA767F207D7EE6CE + 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 + + isa + XCBuildConfiguration + name + Debug + + 6003F5C1195388D20070C39A + + baseConfigurationReference + BFB4BE760737508B3CFC23B2 + 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 + + isa + XCBuildConfiguration + name + Release + + 6003F5C2195388D20070C39A + + buildConfigurations + + 6003F5C3195388D20070C39A + 6003F5C4195388D20070C39A + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 6003F5C3195388D20070C39A + + baseConfigurationReference + 73CCD82196AABD64F2807C7B + 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 + + isa + XCBuildConfiguration + name + Debug + + 6003F5C4195388D20070C39A + + baseConfigurationReference + 1A81C3BE3E54961CD827EAE3 + 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 + + isa + XCBuildConfiguration + name + Release + + 606FC2411953D9B200FFA9A0 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Tests-Prefix.pch + sourceTree + <group> + + 60FF7A9C1954A5C5007DD14C + + children + + E9675D953C6DCDE71A1BDFD4 + 4CCE21315897B7D544C83242 + B2ADC7027D4B025ABCA7999F + B2ADC65E342ADA697322D68C + + isa + PBXGroup + name + Podspec Metadata + sourceTree + <group> + + 73CCD82196AABD64F2807C7B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-SwaggerClient_Tests.debug.xcconfig + path + Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig + sourceTree + <group> + + 799E7E29D924C30424DFBA28 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null +if [[ $? != 0 ]] ; then + cat << EOM +error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. +EOM + exit 1 +fi + + showEnvVarsInLog + 0 + + 7B069562A9F91E498732474F + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null +if [[ $? != 0 ]] ; then + cat << EOM +error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. +EOM + exit 1 +fi + + showEnvVarsInLog + 0 + + 8D46325ECAD48245C07F6733 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-SwaggerClient_Example.a + sourceTree + BUILT_PRODUCTS_DIR + + 94BE6BE84795B5034A811E61 + + fileRef + 8D46325ECAD48245C07F6733 + isa + PBXBuildFile + + AA7CAD658C61D6EBA222B5F8 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh" + + showEnvVarsInLog + 0 + + B2ADC084A2C0BDF217832B03 + + isa + PBXFileReference + lastKnownFileType + file.storyboard + name + Launch Screen.storyboard + path + SwaggerClient/Launch Screen.storyboard + sourceTree + <group> + + B2ADC0B1C8A60A05C48B4DF7 + + fileRef + B2ADC55130D5E329ED945E8F + isa + PBXBuildFile + + B2ADC17C287DCABF329BA8AC + + fileRef + B2ADC7027D4B025ABCA7999F + isa + PBXBuildFile + + B2ADC2D632658A5F73C6CE66 + + fileRef + B2ADC65E342ADA697322D68C + isa + PBXBuildFile + + B2ADC2F3483B3117A00FA91C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + DatabaseHelper.h + sourceTree + <group> + + B2ADC3C7634D15595DD14814 + + fileRef + B2ADC838FCC22F4BC6C41106 + isa + PBXBuildFile + + B2ADC55130D5E329ED945E8F + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + DatabaseHelper.m + sourceTree + <group> + + B2ADC56977372855A63F4E4D + + fileRef + B2ADC084A2C0BDF217832B03 + isa + PBXBuildFile + + B2ADC65E342ADA697322D68C + + isa + PBXFileReference + lastKnownFileType + folder.assetcatalog + name + Images.xcassets + path + SwaggerClient/Images.xcassets + sourceTree + <group> + + B2ADC7027D4B025ABCA7999F + + isa + PBXFileReference + lastKnownFileType + file.storyboard + name + Main.storyboard + path + SwaggerClient/Main.storyboard + sourceTree + <group> + + B2ADC838FCC22F4BC6C41106 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + BuildersTest.m + sourceTree + <group> + + B2ADCA62DE4AC0F5BAB42208 + + children + + B2ADC2F3483B3117A00FA91C + B2ADC55130D5E329ED945E8F + + isa + PBXGroup + path + Helpers + sourceTree + <group> + + BFB4BE760737508B3CFC23B2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-SwaggerClient_Example.release.xcconfig + path + Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig + sourceTree + <group> + + CCE77F10C6D41F74B075ECD0 + + children + + E445A633FA767F207D7EE6CE + BFB4BE760737508B3CFC23B2 + 73CCD82196AABD64F2807C7B + 1A81C3BE3E54961CD827EAE3 + + isa + PBXGroup + name + Pods + sourceTree + <group> + + E337D7E459CCFFDF27046FFC + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh" + + showEnvVarsInLog + 0 + + E445A633FA767F207D7EE6CE + + includeInIndex + 1 + isa + PBXFileReference + 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 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + name + SwaggerClient.podspec + path + ../SwaggerClient.podspec + sourceTree + <group> + + FDEF5BA3CF9CFFDEB5A47DB4 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-SwaggerClient_Tests.a + sourceTree + BUILT_PRODUCTS_DIR + + FF3F107CF27E0A54D86C49F5 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-frameworks.sh" + + showEnvVarsInLog + 0 + + + rootObject + 6003F582195388D10070C39A + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m index 7f8e3d67881b..d1ee531e2f05 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m @@ -10,7 +10,7 @@ #import #import #import -#import +#import @interface SWGViewController () @@ -22,7 +22,7 @@ { [super viewDidLoad]; - SWGConfiguration *config = [SWGConfiguration sharedConfig]; + SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; config.debug = YES; SWGPetApi *api = [[SWGPetApi alloc] init]; diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index 808a950606e1..3bf3052f514c 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi - API version: 1.0.0 - Package version: -- Build date: 2016-07-19T16:53:24.981+08:00 +- Build date: 2016-08-04T12:24:22.869+02:00 - Build package: class io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -40,7 +40,7 @@ Import the following: ```objc #import -#import +#import // load models #import #import @@ -64,7 +64,7 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; @@ -124,12 +124,6 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## petstore_auth - **Type**: OAuth @@ -139,6 +133,12 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## Author diff --git a/samples/client/petstore/objc/default/SwaggerClient.podspec b/samples/client/petstore/objc/default/SwaggerClient.podspec index 934e35a2a6b7..32d8e336da7c 100644 --- a/samples/client/petstore/objc/default/SwaggerClient.podspec +++ b/samples/client/petstore/objc/default/SwaggerClient.podspec @@ -32,6 +32,6 @@ Pod::Spec.new do |s| s.dependency 'AFNetworking', '~> 3' s.dependency 'JSONModel', '~> 1.2' - s.dependency 'ISO8601', '~> 0.5' + s.dependency 'ISO8601', '~> 0.6' end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h index 97f914a627ef..ade955b27f80 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -32,7 +32,7 @@ extern NSString* kSWGPetApiErrorDomain; extern NSInteger kSWGPetApiMissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; /// Add a new pet to the store /// @@ -42,7 +42,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:405 message:"Invalid input" /// /// @return --(NSNumber*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -55,7 +55,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:400 message:"Invalid pet value" /// /// @return --(NSNumber*) deletePetWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler; @@ -69,7 +69,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:400 message:"Invalid status value" /// /// @return NSArray* --(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler; @@ -82,7 +82,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:400 message:"Invalid tag value" /// /// @return NSArray* --(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler; @@ -96,7 +96,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:404 message:"Pet not found" /// /// @return SWGPet* --(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; @@ -110,7 +110,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:405 message:"Validation exception" /// /// @return --(NSNumber*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -124,7 +124,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:405 message:"Invalid input" /// /// @return --(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler; @@ -140,7 +140,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) uploadFileWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index e35421fc5202..5551bffae9a8 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -5,7 +5,7 @@ @interface SWGPetApi () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *defaultHeaders; @end @@ -19,19 +19,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[SWGApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[SWGApiClient sharedClient]]; } -- (id) initWithApiClient:(SWGApiClient *)apiClient { + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; @@ -42,15 +34,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; #pragma mark - -+ (instancetype)sharedAPI { - static SWGPetApi *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { return self.defaultHeaders[key]; } @@ -63,10 +46,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; [self.defaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [SWGApiClient requestQueueSize]; -} - #pragma mark - Api Methods /// @@ -76,7 +55,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -124,8 +103,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -137,7 +115,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) deletePetWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'petId' is set @@ -202,8 +180,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -213,7 +190,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns NSArray* /// --(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; @@ -264,8 +241,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler((NSArray*)data, error); } - } - ]; + }]; } /// @@ -275,7 +251,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns NSArray* /// --(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; @@ -326,8 +302,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler((NSArray*)data, error); } - } - ]; + }]; } /// @@ -337,7 +312,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns SWGPet* /// --(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { // verify the required parameter 'petId' is set if (petId == nil) { @@ -376,7 +351,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"api_key", @"petstore_auth"]; + NSArray *authSettings = @[@"petstore_auth", @"api_key"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; @@ -398,8 +373,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler((SWGPet*)data, error); } - } - ]; + }]; } /// @@ -409,7 +383,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -457,8 +431,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -472,7 +445,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler { @@ -541,8 +514,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -556,7 +528,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) uploadFileWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file completionHandler: (void (^)(NSError* error)) handler { @@ -623,8 +595,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h index bbd588dba259..92aeefb176ed 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -32,7 +32,7 @@ extern NSString* kSWGStoreApiErrorDomain; extern NSInteger kSWGStoreApiMissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; /// Delete purchase order by ID /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -43,7 +43,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:404 message:"Order not found" /// /// @return --(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler; @@ -54,7 +54,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:200 message:"successful operation" /// /// @return NSDictionary* --(NSNumber*) getInventoryWithCompletionHandler: +-(NSURLSessionTask*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler; @@ -68,7 +68,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:404 message:"Order not found" /// /// @return SWGOrder* --(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; @@ -81,7 +81,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:400 message:"Invalid Order" /// /// @return SWGOrder* --(NSNumber*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m index e5964200f208..a275c1f0568f 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -5,7 +5,7 @@ @interface SWGStoreApi () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *defaultHeaders; @end @@ -19,19 +19,11 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[SWGApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[SWGApiClient sharedClient]]; } -- (id) initWithApiClient:(SWGApiClient *)apiClient { + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; @@ -42,15 +34,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; #pragma mark - -+ (instancetype)sharedAPI { - static SWGStoreApi *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { return self.defaultHeaders[key]; } @@ -63,10 +46,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; [self.defaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [SWGApiClient requestQueueSize]; -} - #pragma mark - Api Methods /// @@ -76,7 +55,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'orderId' is set if (orderId == nil) { @@ -137,8 +116,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -146,7 +124,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// Returns a map of status codes to quantities /// @returns NSDictionary* /// --(NSNumber*) getInventoryWithCompletionHandler: +-(NSURLSessionTask*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; @@ -193,8 +171,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; if(handler) { handler((NSDictionary*)data, error); } - } - ]; + }]; } /// @@ -204,7 +181,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// @returns SWGOrder* /// --(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { // verify the required parameter 'orderId' is set if (orderId == nil) { @@ -265,8 +242,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; if(handler) { handler((SWGOrder*)data, error); } - } - ]; + }]; } /// @@ -276,7 +252,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// @returns SWGOrder* /// --(NSNumber*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -324,8 +300,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; if(handler) { handler((SWGOrder*)data, error); } - } - ]; + }]; } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h index 67f8ec9cbb21..2c35bdcb7b06 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -32,7 +32,7 @@ extern NSString* kSWGUserApiErrorDomain; extern NSInteger kSWGUserApiMissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; /// Create user /// This can only be done by the logged in user. @@ -42,7 +42,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; @@ -54,7 +54,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -66,7 +66,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -79,7 +79,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:404 message:"User not found" /// /// @return --(NSNumber*) deleteUserWithUsername: (NSString*) username +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler; @@ -93,7 +93,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:404 message:"User not found" /// /// @return SWGUser* --(NSNumber*) getUserByNameWithUsername: (NSString*) username +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; @@ -107,7 +107,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:400 message:"Invalid username/password supplied" /// /// @return NSString* --(NSNumber*) loginUserWithUsername: (NSString*) username +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler; @@ -119,7 +119,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:0 message:"successful operation" /// /// @return --(NSNumber*) logoutUserWithCompletionHandler: +-(NSURLSessionTask*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler; @@ -133,7 +133,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:404 message:"User not found" /// /// @return --(NSNumber*) updateUserWithUsername: (NSString*) username +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m index 6ffb578ed76e..58e1729f4908 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -5,7 +5,7 @@ @interface SWGUserApi () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *defaultHeaders; @end @@ -19,19 +19,11 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[SWGApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[SWGApiClient sharedClient]]; } -- (id) initWithApiClient:(SWGApiClient *)apiClient { + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; @@ -42,15 +34,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; #pragma mark - -+ (instancetype)sharedAPI { - static SWGUserApi *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { return self.defaultHeaders[key]; } @@ -63,10 +46,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; [self.defaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [SWGApiClient requestQueueSize]; -} - #pragma mark - Api Methods /// @@ -76,7 +55,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -124,8 +103,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -135,7 +113,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -183,8 +161,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -194,7 +171,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -242,8 +219,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -253,7 +229,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) deleteUserWithUsername: (NSString*) username +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -314,8 +290,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -325,7 +300,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns SWGUser* /// --(NSNumber*) getUserByNameWithUsername: (NSString*) username +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -386,8 +361,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler((SWGUser*)data, error); } - } - ]; + }]; } /// @@ -399,7 +373,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns NSString* /// --(NSNumber*) loginUserWithUsername: (NSString*) username +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; @@ -453,8 +427,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler((NSString*)data, error); } - } - ]; + }]; } /// @@ -462,7 +435,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) logoutUserWithCompletionHandler: +-(NSURLSessionTask*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; @@ -509,8 +482,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } /// @@ -522,7 +494,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSNumber*) updateUserWithUsername: (NSString*) username +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set @@ -585,8 +557,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index dd8e721b3b91..ace66ba3146b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -1,5 +1,4 @@ #import -#import #import /** diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m index cec8bdeea271..b544a1dae58b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -1,3 +1,4 @@ +#import #import "JSONValueTransformer+ISO8601.h" @implementation JSONValueTransformer (ISO8601) diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h index 93b564be3d12..c02d289a336f 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h @@ -28,15 +28,13 @@ @protocol SWGApi -@property(nonatomic, assign) SWGApiClient *apiClient; +@property(readonly, nonatomic, strong) SWGApiClient *apiClient; --(id) initWithApiClient:(SWGApiClient *)apiClient; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; -(void) addHeader:(NSString*)value forKey:(NSString*)key DEPRECATED_MSG_ATTRIBUTE("setDefaultHeaderValue:forKey:"); -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; -(NSString*) defaultHeaderForKey:(NSString*)key; --(NSUInteger) requestQueueSize; - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h index 2ec5c9b0fcc4..4f7a6fda11a4 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h @@ -1,13 +1,7 @@ -#import -#import #import -#import "SWGJSONResponseSerializer.h" -#import "SWGJSONRequestSerializer.h" -#import "SWGQueryParamCollection.h" #import "SWGConfiguration.h" #import "SWGResponseDeserializer.h" #import "SWGSanitizer.h" -#import "SWGLogger.h" /** * Swagger Petstore @@ -33,16 +27,6 @@ * limitations under the License. */ -#import "SWGCategory.h" -#import "SWGOrder.h" -#import "SWGPet.h" -#import "SWGTag.h" -#import "SWGUser.h" - - - -@class SWGConfiguration; - /** * A key for `NSError` user info dictionaries. * @@ -50,15 +34,15 @@ */ extern NSString *const SWGResponseObjectErrorKey; + @interface SWGApiClient : AFHTTPSessionManager +@property (nonatomic, strong, readonly) id configuration; + @property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy; @property(nonatomic, assign) NSTimeInterval timeoutInterval; @property(nonatomic, readonly) NSOperationQueue* queue; -/// In order to ensure the HTTPResponseHeaders are correct, it is recommended to initialize one SWGApiClient instance per thread. -@property(nonatomic, readonly) NSDictionary* HTTPResponseHeaders; - @property(nonatomic, strong) id responseDeserializer; @property(nonatomic, strong) id sanitizer; @@ -74,13 +58,6 @@ extern NSString *const SWGResponseObjectErrorKey; */ +(void)setCacheEnabled:(BOOL) enabled; -/** - * Gets the request queue size - * - * @return The size of `queuedRequests` static variable. - */ -+(NSUInteger)requestQueueSize; - /** * Sets the client unreachable * @@ -109,27 +86,6 @@ extern NSString *const SWGResponseObjectErrorKey; */ +(AFNetworkReachabilityStatus) getReachabilityStatus; -/** - * Gets the next request id - * - * @return The next executed request id. - */ -+(NSNumber*) nextRequestId; - -/** - * Generates request id and add it to the queue - * - * @return The next executed request id. - */ -+(NSNumber*) queueRequest; - -/** - * Removes request id from the queue - * - * @param requestId The request which will be removed. - */ -+(void) cancelRequest:(NSNumber*)requestId; - /** * Customizes the behavior when the reachability changed * @@ -137,6 +93,11 @@ extern NSString *const SWGResponseObjectErrorKey; */ +(void) setReachabilityChangeBlock:(void(^)(int))changeBlock; +/** + * Gets client singleton instance + */ ++ (instancetype) sharedClient; + /** * Sets the api client reachability strategy */ @@ -162,6 +123,14 @@ extern NSString *const SWGResponseObjectErrorKey; queryParams:(NSDictionary **)querys WithAuthSettings:(NSArray *)authSettings; + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + /** * Performs request * @@ -176,21 +145,21 @@ extern NSString *const SWGResponseObjectErrorKey; * @param responseContentType Response content-type. * @param completionBlock The block will be executed when the request completed. * - * @return The request id. + * @return The created session task. */ --(NSNumber*) requestWithPath:(NSString*) path - method:(NSString*) method - pathParams:(NSDictionary *) pathParams - queryParams:(NSDictionary*) queryParams - formParams:(NSDictionary *) formParams - files:(NSDictionary *) files - body:(id) body - headerParams:(NSDictionary*) headerParams - authSettings:(NSArray *) authSettings - requestContentType:(NSString*) requestContentType - responseContentType:(NSString*) responseContentType - responseType:(NSString *) responseType - completionBlock:(void (^)(id, NSError *))completionBlock; +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; /** * Custom security policy @@ -199,12 +168,4 @@ extern NSString *const SWGResponseObjectErrorKey; */ - (AFSecurityPolicy *) customSecurityPolicy; -/** - * SWGConfiguration return sharedConfig - * - * @return SWGConfiguration - */ -- (SWGConfiguration*) configuration; - - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m index f004200b2eb8..d4758d36b03a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m @@ -1,10 +1,16 @@ +#import + #import "SWGApiClient.h" +#import "SWGJSONRequestSerializer.h" +#import "SWGJSONResponseSerializer.h" +#import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" + + NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; -static NSUInteger requestId = 0; static bool offlineState = false; -static NSMutableSet * queuedRequests = nil; static bool cacheEnabled = false; static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable; static void (^reachabilityChangeBlock)(int); @@ -36,38 +42,61 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { @interface SWGApiClient () -@property (nonatomic, strong) NSDictionary* HTTPResponseHeaders; +@property (nonatomic, strong, readwrite) id configuration; @end @implementation SWGApiClient +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static SWGApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + - (instancetype)init { - NSString *baseUrl = [[SWGConfiguration sharedConfig] host]; - return [self initWithBaseURL:[NSURL URLWithString:baseUrl]]; + + return [self initWithConfiguration:[SWGDefaultConfiguration sharedConfig]]; } - (instancetype)initWithBaseURL:(NSURL *)url { + + return [self initWithBaseURL:url + configuration:[SWGDefaultConfiguration sharedConfig]]; + +} + +- (instancetype)initWithConfiguration:(id)configuration { + + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url + configuration:(id)configuration { + self = [super initWithBaseURL:url]; if (self) { - self.timeoutInterval = 60; + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[SWGResponseDeserializer alloc] init]; + _sanitizer = [[SWGSanitizer alloc] init]; + self.requestSerializer = [AFJSONRequestSerializer serializer]; self.responseSerializer = [AFJSONResponseSerializer serializer]; self.securityPolicy = [self customSecurityPolicy]; - self.responseDeserializer = [[SWGResponseDeserializer alloc] init]; - self.sanitizer = [[SWGSanitizer alloc] init]; + // configure reachability [self configureCacheReachibility]; } - return self; -} -+ (void)initialize { - if (self == [SWGApiClient class]) { - queuedRequests = [[NSMutableSet alloc] init]; - // initialize URL cache - [self configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024]; - } + return self; } #pragma mark - Setter Methods @@ -113,43 +142,6 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [NSURLCache setSharedURLCache:cache]; } -#pragma mark - Request Methods - -+(NSUInteger)requestQueueSize { - return [queuedRequests count]; -} - -+(NSNumber*) nextRequestId { - @synchronized(self) { - return @(++requestId); - } -} - -+(NSNumber*) queueRequest { - NSNumber* requestId = [[self class] nextRequestId]; - SWGDebugLog(@"added %@ to request queue", requestId); - [queuedRequests addObject:requestId]; - return requestId; -} - -+(void) cancelRequest:(NSNumber*)requestId { - [queuedRequests removeObject:requestId]; -} - --(Boolean) executeRequestWithId:(NSNumber*) requestId { - NSSet* matchingItems = [queuedRequests objectsPassingTest:^BOOL(id obj, BOOL *stop) { - return [obj intValue] == [requestId intValue]; - }]; - - if (matchingItems.count == 1) { - SWGDebugLog(@"removed request id %@", requestId); - [queuedRequests removeObject:requestId]; - return YES; - } else { - return NO; - } -} - #pragma mark - Reachability Methods +(AFNetworkReachabilityStatus) getReachabilityStatus { @@ -179,23 +171,19 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [self.reachabilityManager startMonitoring]; } -#pragma mark - Operation Methods +#pragma mark - Task Methods -- (void) operationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request + completionBlock: (void (^)(id, NSError *))completionBlock { + + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { SWGDebugLogResponse(response, responseObject,request,error); - strongSelf.HTTPResponseHeaders = SWG__headerFieldsForResponse(response); + if(!error) { completionBlock(responseObject, nil); return; } + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; if (responseObject) { // Add in the (parsed) response body. @@ -204,20 +192,18 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - [op resume]; + + return task; } -- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } - strongSelf.HTTPResponseHeaders = SWG__headerFieldsForResponse(response); +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request + completionBlock: (void (^)(id, NSError *))completionBlock { + + id config = self.configuration; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { SWGDebugLogResponse(response, responseObject,request,error); + if(error) { NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; if (responseObject) { @@ -226,8 +212,9 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); } - NSString *directory = [self configuration].tempFolderPath ?: NSTemporaryDirectory(); - NSString * filename = SWG__fileNameForResponse(response); + + NSString *directory = config.tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = SWG__fileNameForResponse(response); NSString *filepath = [directory stringByAppendingPathComponent:filename]; NSURL *file = [NSURL fileURLWithPath:filepath]; @@ -236,24 +223,26 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(file, nil); }]; - [op resume]; + + return task; } -#pragma mark - Perform Request Methods +#pragma mark - Perform Request Methods + +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { --(NSNumber*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock { // setting request serializer if ([requestContentType isEqualToString:@"application/json"]) { self.requestSerializer = [SWGJSONRequestSerializer serializer]; @@ -359,14 +348,16 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [self postProcessRequest:request]; - NSNumber* requestId = [SWGApiClient queueRequest]; + + NSURLSessionTask *task = nil; + if ([responseType isEqualToString:@"NSURL*"] || [responseType isEqualToString:@"NSURL"]) { - [self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { completionBlock(data, error); }]; } else { - [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { NSError * serializationError; id response = [self.responseDeserializer deserialize:data class:responseType error:&serializationError]; if(!response && !error){ @@ -375,7 +366,10 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(response, error); }]; } - return requestId; + + [task resume]; + + return task; } //Added for easier override to modify request @@ -455,10 +449,11 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - - NSDictionary* configurationAuthSettings = [[self configuration] authSettings]; + + id config = self.configuration; for (NSString *auth in authSettings) { - NSDictionary *authSetting = configurationAuthSettings[auth]; + NSDictionary *authSetting = config.authSettings[auth]; + if(!authSetting) { // auth setting is set only if the key is non-empty continue; } @@ -479,11 +474,11 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { - (AFSecurityPolicy *) customSecurityPolicy { AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - SWGConfiguration *config = [self configuration]; + id config = self.configuration; if (config.sslCaCert) { NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; - [securityPolicy setPinnedCertificates:@[certData]]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; } if (config.verifySSL) { @@ -497,8 +492,4 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { return securityPolicy; } -- (SWGConfiguration*) configuration { - return [SWGConfiguration sharedConfig]; -} - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h new file mode 100644 index 000000000000..6c50d3750b4a --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h @@ -0,0 +1,14 @@ +/** The `SWGBasicAuthTokenProvider` class creates a basic auth token from username and password. + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +#import + +@interface SWGBasicAuthTokenProvider : NSObject + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; + +@end \ No newline at end of file diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m new file mode 100644 index 000000000000..3788009ec587 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m @@ -0,0 +1,19 @@ +#import "SWGBasicAuthTokenProvider.h" + +@implementation SWGBasicAuthTokenProvider + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { + + // return empty string if username and password are empty + if (username.length == 0 && password.length == 0){ + return @""; + } + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h index b6c37405ca2f..a85a47d4bc8f 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h @@ -1,5 +1,4 @@ #import -#import "SWGApiClient.h" #import "SWGLogger.h" /** @@ -26,157 +25,73 @@ * limitations under the License. */ -@class SWGApiClient; - -@interface SWGConfiguration : NSObject +@protocol SWGConfiguration /** - * Default api logger + * Api logger */ -@property (nonatomic, strong) SWGLogger * logger; +@property (readonly, nonatomic) SWGLogger *logger; /** - * Default api client + * Base url */ -@property (nonatomic) SWGApiClient *apiClient; - -/** - * Default base url - */ -@property (nonatomic) NSString *host; +@property (readonly, nonatomic) NSString *host; /** * Api key values for Api Key type Authentication - * - * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. */ -@property (readonly, nonatomic, strong) NSDictionary *apiKey; +@property (readonly, nonatomic) NSDictionary *apiKey; /** * Api key prefix values to be prepend to the respective api key - * - * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. */ -@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; /** * Username for HTTP Basic Authentication */ - @property (nonatomic) NSString *username; +@property (readonly, nonatomic) NSString *username; /** * Password for HTTP Basic Authentication */ -@property (nonatomic) NSString *password; +@property (readonly, nonatomic) NSString *password; /** * Access token for OAuth */ -@property (nonatomic) NSString *accessToken; +@property (readonly, nonatomic) NSString *accessToken; /** * Temp folder for file download */ -@property (nonatomic) NSString *tempFolderPath; +@property (readonly, nonatomic) NSString *tempFolderPath; /** * Debug switch, default false */ -@property (nonatomic) BOOL debug; - -/** - * Gets configuration singleton instance - */ -+ (instancetype) sharedConfig; +@property (readonly, nonatomic) BOOL debug; /** * SSL/TLS verification * Set this to NO to skip verifying SSL certificate when calling API from https server */ -@property (nonatomic) BOOL verifySSL; +@property (readonly, nonatomic) BOOL verifySSL; /** * SSL/TLS verification * Set this to customize the certificate file to verify the peer */ -@property (nonatomic) NSString *sslCaCert; +@property (readonly, nonatomic) NSString *sslCaCert; /** - * Sets API key - * - * To remove a apiKey for an identifier, just set the apiKey to nil. - * - * @param apiKey API key or token. - * @param identifier API key identifier (authentication schema). - * + * Authentication Settings */ -- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; - -/** - * Removes api key - * - * @param identifier API key identifier. - */ -- (void) removeApiKey:(NSString *)identifier; - -/** - * Sets the prefix for API key - * - * @param apiKeyPrefix API key prefix. - * @param identifier API key identifier. - */ -- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; - -/** - * Removes api key prefix - * - * @param identifier API key identifier. - */ -- (void) removeApiKeyPrefix:(NSString *)identifier; - -/** - * Gets API key (with prefix if set) - */ -- (NSString *) getApiKeyWithPrefix:(NSString *) key; - -/** - * Gets Basic Auth token - */ -- (NSString *) getBasicAuthToken; - -/** - * Gets OAuth access token - */ -- (NSString *) getAccessToken; - -/** - * Gets Authentication Settings - */ -- (NSDictionary *) authSettings; +@property (readonly, nonatomic) NSDictionary *authSettings; /** * Default headers for all services */ @property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; -/** -* Removes header from defaultHeaders -* -* @param Header name. -*/ --(void) removeDefaultHeaderForKey:(NSString*)key; - -/** -* Sets the header for key -* -* @param value Value for header name -* @param key Header name -*/ --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; - -/** -* @param Header key name. -*/ --(NSString*) defaultHeaderForKey:(NSString*)key; - -@end +@end \ No newline at end of file diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h new file mode 100644 index 000000000000..cd44d30e551c --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -0,0 +1,175 @@ +#import +#import "SWGConfiguration.h" + +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +@interface SWGDefaultConfiguration : NSObject + + +/** + * Default api logger + */ +@property (nonatomic, strong) SWGLogger * logger; + +/** + * Default base url + */ +@property (nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ + @property (nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (nonatomic) BOOL debug; + +/** + * Gets configuration singleton instance + */ ++ (instancetype) sharedConfig; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (nonatomic) NSString *sslCaCert; + +/** + * Sets API key + * + * To remove a apiKey for an identifier, just set the apiKey to nil. + * + * @param apiKey API key or token. + * @param identifier API key identifier (authentication schema). + * + */ +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; + +/** + * Removes api key + * + * @param identifier API key identifier. + */ +- (void) removeApiKey:(NSString *)identifier; + +/** + * Sets the prefix for API key + * + * @param apiKeyPrefix API key prefix. + * @param identifier API key identifier. + */ +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; + +/** + * Removes api key prefix + * + * @param identifier API key identifier. + */ +- (void) removeApiKeyPrefix:(NSString *)identifier; + +/** + * Gets API key (with prefix if set) + */ +- (NSString *) getApiKeyWithPrefix:(NSString *) key; + +/** + * Gets Basic Auth token + */ +- (NSString *) getBasicAuthToken; + +/** + * Gets OAuth access token + */ +- (NSString *) getAccessToken; + +/** + * Gets Authentication Settings + */ +- (NSDictionary *) authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +/** +* Removes header from defaultHeaders +* +* @param Header name. +*/ +-(void) removeDefaultHeaderForKey:(NSString*)key; + +/** +* Sets the header for key +* +* @param value Value for header name +* @param key Header name +*/ +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; + +/** +* @param Header key name. +*/ +-(NSString*) defaultHeaderForKey:(NSString*)key; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m similarity index 72% rename from samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.m rename to samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m index b21290068a1c..cd37ae358590 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m @@ -1,6 +1,7 @@ -#import "SWGConfiguration.h" +#import "SWGDefaultConfiguration.h" +#import "SWGBasicAuthTokenProvider.h" -@interface SWGConfiguration () +@interface SWGDefaultConfiguration () @property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; @property (nonatomic, strong) NSMutableDictionary *mutableApiKey; @@ -8,12 +9,12 @@ @end -@implementation SWGConfiguration +@implementation SWGDefaultConfiguration #pragma mark - Singleton Methods + (instancetype) sharedConfig { - static SWGConfiguration *shardConfig = nil; + static SWGDefaultConfiguration *shardConfig = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ shardConfig = [[self alloc] init]; @@ -26,17 +27,16 @@ - (instancetype) init { self = [super init]; if (self) { - self.apiClient = nil; - self.host = @"http://petstore.swagger.io/v2"; - self.username = @""; - self.password = @""; - self.accessToken= @""; - self.verifySSL = YES; - self.mutableApiKey = [NSMutableDictionary dictionary]; - self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; - self.mutableDefaultHeaders = [NSMutableDictionary dictionary]; - self.mutableDefaultHeaders[@"User-Agent"] = [NSString stringWithFormat:@"Swagger-Codegen/1.0.0/objc (%@; iOS %@; Scale/%0.2f)",[[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]]; - self.logger = [SWGLogger sharedLogger]; + _host = @"http://petstore.swagger.io/v2"; + _username = @""; + _password = @""; + _accessToken= @""; + _verifySSL = YES; + _mutableApiKey = [NSMutableDictionary dictionary]; + _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + ; + _logger = [SWGLogger sharedLogger]; } return self; } @@ -58,16 +58,9 @@ } - (NSString *) getBasicAuthToken { - // return empty string if username and password are empty - if (self.username.length == 0 && self.password.length == 0){ - return @""; - } - NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password]; - NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; - basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; - - return basicAuthCredentials; + NSString *basicAuthToken = [SWGBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; + return basicAuthToken; } - (NSString *) getAccessToken { @@ -110,13 +103,6 @@ - (NSDictionary *) authSettings { return @{ - @"api_key": - @{ - @"type": @"api_key", - @"in": @"header", - @"key": @"api_key", - @"value": [self getApiKeyWithPrefix:@"api_key"] - }, @"petstore_auth": @{ @"type": @"oauth", @@ -124,6 +110,13 @@ @"key": @"Authorization", @"value": [self getAccessToken] }, + @"api_key": + @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"api_key", + @"value": [self getApiKeyWithPrefix:@"api_key"] + }, }; } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m index 8085c404f7e2..db970d34669b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m @@ -2,6 +2,35 @@ @implementation SWGObject +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + }); + + BOOL initSync; + @synchronized([self class]) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + /** * Gets the string presentation of the object. * This method will be called when logging model object using `NSLog`. diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m index 833030451853..9aa8a091762d 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m @@ -5,11 +5,15 @@ @synthesize values = _values; @synthesize format = _format; -- (id) initWithValuesAndFormat: (NSArray*) values - format: (NSString*) format { - _values = values; - _format = format; +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + self = [super init]; + if (self) { + _values = values; + _format = format; + } + return self; } diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 25e7b5a2d2c2..d2cacf84e6e7 100644 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -1,645 +1,1570 @@ -// !$*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 */; }; - 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 */; }; - 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; }; - B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */; }; - B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC7027D4B025ABCA7999F /* Main.storyboard */; }; - B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC65E342ADA697322D68C /* Images.xcassets */; }; - B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */; }; - CF0ADB481B5F95D6008A2729 /* PetTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF0ADB471B5F95D6008A2729 /* PetTest.m */; }; - CF8F71391B5F73AC00162980 /* DeserializationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF8F71381B5F73AC00162980 /* DeserializationTest.m */; }; - 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 = ""; }; - 4CCE21315897B7D544C83242 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 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 = ""; }; - 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = ""; }; - 6003F59C195388D20070C39A /* SWGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGAppDelegate.h; sourceTree = ""; }; - 6003F59D195388D20070C39A /* SWGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGAppDelegate.m; sourceTree = ""; }; - 6003F5A5195388D20070C39A /* SWGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGViewController.h; sourceTree = ""; }; - 6003F5A6195388D20070C39A /* SWGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGViewController.m; sourceTree = ""; }; - 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 = ""; }; - 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; - 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; - 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 = ""; }; - 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "SwaggerClient/Launch Screen.storyboard"; sourceTree = ""; }; - B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseHelper.h; sourceTree = ""; }; - B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatabaseHelper.m; sourceTree = ""; }; - B2ADC65E342ADA697322D68C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwaggerClient/Images.xcassets; sourceTree = ""; }; - B2ADC7027D4B025ABCA7999F /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Main.storyboard; path = SwaggerClient/Main.storyboard; sourceTree = ""; }; - 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 = ""; }; - CF0ADB471B5F95D6008A2729 /* PetTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetTest.m; sourceTree = ""; }; - CF8F71381B5F73AC00162980 /* DeserializationTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeserializationTest.m; sourceTree = ""; }; - CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetApiTest.m; sourceTree = ""; }; - CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreApiTest.m; sourceTree = ""; }; - CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClientTest.m; sourceTree = ""; }; - CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserApiTest.m; sourceTree = ""; }; - 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 = ""; }; - E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwaggerClient.podspec; path = ../SwaggerClient.podspec; sourceTree = ""; }; - 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 = ""; - }; - 6003F58B195388D20070C39A /* Products */ = { - isa = PBXGroup; - children = ( - 6003F58A195388D20070C39A /* SwaggerClient_Example.app */, - 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */, - B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */, - ); - name = Products; - sourceTree = ""; - }; - 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 = ""; - }; - 6003F593195388D20070C39A /* Example for SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6003F59C195388D20070C39A /* SWGAppDelegate.h */, - 6003F59D195388D20070C39A /* SWGAppDelegate.m */, - 6003F5A5195388D20070C39A /* SWGViewController.h */, - 6003F5A6195388D20070C39A /* SWGViewController.m */, - 6003F594195388D20070C39A /* Supporting Files */, - ); - name = "Example for SwaggerClient"; - path = SwaggerClient; - sourceTree = ""; - }; - 6003F594195388D20070C39A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6003F595195388D20070C39A /* SwaggerClient-Info.plist */, - 6003F596195388D20070C39A /* InfoPlist.strings */, - 6003F599195388D20070C39A /* main.m */, - 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 6003F5B5195388D20070C39A /* Tests */ = { - isa = PBXGroup; - children = ( - CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */, - CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */, - CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */, - CF0ADB471B5F95D6008A2729 /* PetTest.m */, - CF8F71381B5F73AC00162980 /* DeserializationTest.m */, - CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */, - 6003F5BB195388D20070C39A /* Tests.m */, - 6003F5B6195388D20070C39A /* Supporting Files */, - B2ADCA62DE4AC0F5BAB42208 /* Helpers */, - ); - path = Tests; - sourceTree = ""; - }; - 6003F5B6195388D20070C39A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6003F5B7195388D20070C39A /* Tests-Info.plist */, - 6003F5B8195388D20070C39A /* InfoPlist.strings */, - 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { - isa = PBXGroup; - children = ( - E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */, - 4CCE21315897B7D544C83242 /* README.md */, - B2ADC7027D4B025ABCA7999F /* Main.storyboard */, - B2ADC65E342ADA697322D68C /* Images.xcassets */, - ); - name = "Podspec Metadata"; - sourceTree = ""; - }; - B2ADCA62DE4AC0F5BAB42208 /* Helpers */ = { - isa = PBXGroup; - children = ( - B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */, - B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */, - ); - path = Helpers; - sourceTree = ""; - }; - 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 = ""; - }; -/* 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 */, - 183E54C09C54DAEB54B2546F /* 📦 Embed Pods Frameworks */, - ); - 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 */, - 111D7956304BD6E860AA8709 /* 📦 Embed Pods Frameworks */, - ); - 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 = ( - 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, - B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */, - B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */, - B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6003F5AC195388D20070C39A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 111D7956304BD6E860AA8709 /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 183E54C09C54DAEB54B2546F /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 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 */, - CF0ADB481B5F95D6008A2729 /* PetTest.m in Sources */, - CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */, - 6003F5BC195388D20070C39A /* Tests.m in Sources */, - CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */, - CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */, - CF8F71391B5F73AC00162980 /* DeserializationTest.m in Sources */, - B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.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 = ""; - }; - 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 6003F5B9195388D20070C39A /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* 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 */; -} + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 111D7956304BD6E860AA8709 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh" + + showEnvVarsInLog + 0 + + 158CE3AA214CB1B31C7ADC48 + + fileRef + FDEF5BA3CF9CFFDEB5A47DB4 + isa + PBXBuildFile + + 183E54C09C54DAEB54B2546F + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-frameworks.sh" + + showEnvVarsInLog + 0 + + 1A81C3BE3E54961CD827EAE3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-SwaggerClient_Tests.release.xcconfig + path + Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.release.xcconfig + sourceTree + <group> + + 429AF5C69E165ED75311B4B0 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh" + + showEnvVarsInLog + 0 + + 4CCE21315897B7D544C83242 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + net.daringfireball.markdown + name + README.md + path + ../README.md + sourceTree + <group> + + 6003F581195388D10070C39A + + children + + 60FF7A9C1954A5C5007DD14C + 6003F593195388D20070C39A + 6003F5B5195388D20070C39A + 6003F58C195388D20070C39A + 6003F58B195388D20070C39A + CCE77F10C6D41F74B075ECD0 + + isa + PBXGroup + sourceTree + <group> + + 6003F582195388D10070C39A + + attributes + + CLASSPREFIX + SWG + LastUpgradeCheck + 0510 + ORGANIZATIONNAME + geekerzp + + buildConfigurationList + 6003F585195388D10070C39A + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 6003F581195388D10070C39A + productRefGroup + 6003F58B195388D20070C39A + projectDirPath + + projectReferences + + projectRoot + + targets + + 6003F589195388D20070C39A + 6003F5AD195388D20070C39A + + + 6003F585195388D10070C39A + + buildConfigurations + + 6003F5BD195388D20070C39A + 6003F5BE195388D20070C39A + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 6003F586195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F59E195388D20070C39A + 6003F5A7195388D20070C39A + 6003F59A195388D20070C39A + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F587195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F590195388D20070C39A + 6003F592195388D20070C39A + 6003F58E195388D20070C39A + 94BE6BE84795B5034A811E61 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F588195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F598195388D20070C39A + B2ADC17C287DCABF329BA8AC + B2ADC2D632658A5F73C6CE66 + B2ADC56977372855A63F4E4D + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F589195388D20070C39A + + buildConfigurationList + 6003F5BF195388D20070C39A + buildPhases + + 799E7E29D924C30424DFBA28 + 6003F586195388D20070C39A + 6003F587195388D20070C39A + 6003F588195388D20070C39A + 429AF5C69E165ED75311B4B0 + 183E54C09C54DAEB54B2546F + DA8DD6AAE903F2CD38F2D9D5 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + SwaggerClient_Example + productName + SwaggerClient + productReference + 6003F58A195388D20070C39A + productType + com.apple.product-type.application + + 6003F58A195388D20070C39A + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + SwaggerClient_Example.app + sourceTree + BUILT_PRODUCTS_DIR + + 6003F58B195388D20070C39A + + children + + 6003F58A195388D20070C39A + 6003F5AE195388D20070C39A + B2ADC084A2C0BDF217832B03 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 6003F58C195388D20070C39A + + children + + 6003F58D195388D20070C39A + 6003F58F195388D20070C39A + 6003F591195388D20070C39A + 6003F5AF195388D20070C39A + 8D46325ECAD48245C07F6733 + FDEF5BA3CF9CFFDEB5A47DB4 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 6003F58D195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + Foundation.framework + path + System/Library/Frameworks/Foundation.framework + sourceTree + SDKROOT + + 6003F58E195388D20070C39A + + fileRef + 6003F58D195388D20070C39A + isa + PBXBuildFile + + 6003F58F195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + CoreGraphics.framework + path + System/Library/Frameworks/CoreGraphics.framework + sourceTree + SDKROOT + + 6003F590195388D20070C39A + + fileRef + 6003F58F195388D20070C39A + isa + PBXBuildFile + + 6003F591195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + UIKit.framework + path + System/Library/Frameworks/UIKit.framework + sourceTree + SDKROOT + + 6003F592195388D20070C39A + + fileRef + 6003F591195388D20070C39A + isa + PBXBuildFile + + 6003F593195388D20070C39A + + children + + 6003F59C195388D20070C39A + 6003F59D195388D20070C39A + 6003F5A5195388D20070C39A + 6003F5A6195388D20070C39A + 6003F594195388D20070C39A + + isa + PBXGroup + name + Example for SwaggerClient + path + SwaggerClient + sourceTree + <group> + + 6003F594195388D20070C39A + + children + + 6003F595195388D20070C39A + 6003F596195388D20070C39A + 6003F599195388D20070C39A + 6003F59B195388D20070C39A + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 6003F595195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + SwaggerClient-Info.plist + sourceTree + <group> + + 6003F596195388D20070C39A + + children + + 6003F597195388D20070C39A + + isa + PBXVariantGroup + name + InfoPlist.strings + sourceTree + <group> + + 6003F597195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + text.plist.strings + name + en + path + en.lproj/InfoPlist.strings + sourceTree + <group> + + 6003F598195388D20070C39A + + fileRef + 6003F596195388D20070C39A + isa + PBXBuildFile + + 6003F599195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 6003F59A195388D20070C39A + + fileRef + 6003F599195388D20070C39A + isa + PBXBuildFile + + 6003F59B195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SwaggerClient-Prefix.pch + sourceTree + <group> + + 6003F59C195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SWGAppDelegate.h + sourceTree + <group> + + 6003F59D195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SWGAppDelegate.m + sourceTree + <group> + + 6003F59E195388D20070C39A + + fileRef + 6003F59D195388D20070C39A + isa + PBXBuildFile + + 6003F5A5195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SWGViewController.h + sourceTree + <group> + + 6003F5A6195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SWGViewController.m + sourceTree + <group> + + 6003F5A7195388D20070C39A + + fileRef + 6003F5A6195388D20070C39A + isa + PBXBuildFile + + 6003F5AA195388D20070C39A + + buildActionMask + 2147483647 + files + + CFDFB4141B3CFFF6009739C5 + CF0ADB481B5F95D6008A2729 + CFDFB4131B3CFFDD009739C5 + 6003F5BC195388D20070C39A + CFDFB4151B3D000B009739C5 + CFDFB4121B3CFFA8009739C5 + CF8F71391B5F73AC00162980 + B2ADC0B1C8A60A05C48B4DF7 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F5AB195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F5B0195388D20070C39A + 6003F5B2195388D20070C39A + 6003F5B1195388D20070C39A + 158CE3AA214CB1B31C7ADC48 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F5AC195388D20070C39A + + buildActionMask + 2147483647 + files + + 6003F5BA195388D20070C39A + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6003F5AD195388D20070C39A + + buildConfigurationList + 6003F5C2195388D20070C39A + buildPhases + + 7B069562A9F91E498732474F + 6003F5AA195388D20070C39A + 6003F5AB195388D20070C39A + 6003F5AC195388D20070C39A + E337D7E459CCFFDF27046FFC + 111D7956304BD6E860AA8709 + FD42985CC653969FE997DEC9 + + buildRules + + dependencies + + 6003F5B4195388D20070C39A + + isa + PBXNativeTarget + name + SwaggerClient_Tests + productName + SwaggerClientTests + productReference + 6003F5AE195388D20070C39A + productType + com.apple.product-type.bundle.unit-test + + 6003F5AE195388D20070C39A + + explicitFileType + wrapper.cfbundle + includeInIndex + 0 + isa + PBXFileReference + path + SwaggerClient_Tests.xctest + sourceTree + BUILT_PRODUCTS_DIR + + 6003F5AF195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + XCTest.framework + path + Library/Frameworks/XCTest.framework + sourceTree + DEVELOPER_DIR + + 6003F5B0195388D20070C39A + + fileRef + 6003F5AF195388D20070C39A + isa + PBXBuildFile + + 6003F5B1195388D20070C39A + + fileRef + 6003F58D195388D20070C39A + isa + PBXBuildFile + + 6003F5B2195388D20070C39A + + fileRef + 6003F591195388D20070C39A + isa + PBXBuildFile + + 6003F5B3195388D20070C39A + + containerPortal + 6003F582195388D10070C39A + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 6003F589195388D20070C39A + remoteInfo + SwaggerClient + + 6003F5B4195388D20070C39A + + isa + PBXTargetDependency + target + 6003F589195388D20070C39A + targetProxy + 6003F5B3195388D20070C39A + + 6003F5B5195388D20070C39A + + children + + CFDFB40A1B3CFEC3009739C5 + CFDFB40B1B3CFEC3009739C5 + CFDFB40C1B3CFEC3009739C5 + CF0ADB471B5F95D6008A2729 + CF8F71381B5F73AC00162980 + CFDFB40D1B3CFEC3009739C5 + 6003F5BB195388D20070C39A + 6003F5B6195388D20070C39A + B2ADCA62DE4AC0F5BAB42208 + + isa + PBXGroup + path + Tests + sourceTree + <group> + + 6003F5B6195388D20070C39A + + children + + 6003F5B7195388D20070C39A + 6003F5B8195388D20070C39A + 606FC2411953D9B200FFA9A0 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 6003F5B7195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Tests-Info.plist + sourceTree + <group> + + 6003F5B8195388D20070C39A + + children + + 6003F5B9195388D20070C39A + + isa + PBXVariantGroup + name + InfoPlist.strings + sourceTree + <group> + + 6003F5B9195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + text.plist.strings + name + en + path + en.lproj/InfoPlist.strings + sourceTree + <group> + + 6003F5BA195388D20070C39A + + fileRef + 6003F5B8195388D20070C39A + isa + PBXBuildFile + + 6003F5BB195388D20070C39A + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Tests.m + sourceTree + <group> + + 6003F5BC195388D20070C39A + + fileRef + 6003F5BB195388D20070C39A + isa + PBXBuildFile + + 6003F5BD195388D20070C39A + + 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 + + isa + XCBuildConfiguration + name + Debug + + 6003F5BE195388D20070C39A + + 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 + + isa + XCBuildConfiguration + name + Release + + 6003F5BF195388D20070C39A + + buildConfigurations + + 6003F5C0195388D20070C39A + 6003F5C1195388D20070C39A + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 6003F5C0195388D20070C39A + + baseConfigurationReference + E445A633FA767F207D7EE6CE + 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 + + isa + XCBuildConfiguration + name + Debug + + 6003F5C1195388D20070C39A + + baseConfigurationReference + BFB4BE760737508B3CFC23B2 + 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 + + isa + XCBuildConfiguration + name + Release + + 6003F5C2195388D20070C39A + + buildConfigurations + + 6003F5C3195388D20070C39A + 6003F5C4195388D20070C39A + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 6003F5C3195388D20070C39A + + baseConfigurationReference + 73CCD82196AABD64F2807C7B + 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 + + isa + XCBuildConfiguration + name + Debug + + 6003F5C4195388D20070C39A + + baseConfigurationReference + 1A81C3BE3E54961CD827EAE3 + 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 + + isa + XCBuildConfiguration + name + Release + + 606FC2411953D9B200FFA9A0 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Tests-Prefix.pch + sourceTree + <group> + + 60FF7A9C1954A5C5007DD14C + + children + + E9675D953C6DCDE71A1BDFD4 + 4CCE21315897B7D544C83242 + B2ADC7027D4B025ABCA7999F + B2ADC65E342ADA697322D68C + + isa + PBXGroup + name + Podspec Metadata + sourceTree + <group> + + 73CCD82196AABD64F2807C7B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-SwaggerClient_Tests.debug.xcconfig + path + Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig + sourceTree + <group> + + 799E7E29D924C30424DFBA28 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null +if [[ $? != 0 ]] ; then + cat << EOM +error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. +EOM + exit 1 +fi + + showEnvVarsInLog + 0 + + 7B069562A9F91E498732474F + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null +if [[ $? != 0 ]] ; then + cat << EOM +error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. +EOM + exit 1 +fi + + showEnvVarsInLog + 0 + + 8D46325ECAD48245C07F6733 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-SwaggerClient_Example.a + sourceTree + BUILT_PRODUCTS_DIR + + 94BE6BE84795B5034A811E61 + + fileRef + 8D46325ECAD48245C07F6733 + isa + PBXBuildFile + + B2ADC084A2C0BDF217832B03 + + isa + PBXFileReference + lastKnownFileType + file.storyboard + name + Launch Screen.storyboard + path + SwaggerClient/Launch Screen.storyboard + sourceTree + <group> + + B2ADC0B1C8A60A05C48B4DF7 + + fileRef + B2ADC55130D5E329ED945E8F + isa + PBXBuildFile + + B2ADC17C287DCABF329BA8AC + + fileRef + B2ADC7027D4B025ABCA7999F + isa + PBXBuildFile + + B2ADC2D632658A5F73C6CE66 + + fileRef + B2ADC65E342ADA697322D68C + isa + PBXBuildFile + + B2ADC2F3483B3117A00FA91C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + DatabaseHelper.h + sourceTree + <group> + + B2ADC55130D5E329ED945E8F + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + DatabaseHelper.m + sourceTree + <group> + + B2ADC56977372855A63F4E4D + + fileRef + B2ADC084A2C0BDF217832B03 + isa + PBXBuildFile + + B2ADC65E342ADA697322D68C + + isa + PBXFileReference + lastKnownFileType + folder.assetcatalog + name + Images.xcassets + path + SwaggerClient/Images.xcassets + sourceTree + <group> + + B2ADC7027D4B025ABCA7999F + + isa + PBXFileReference + lastKnownFileType + file.storyboard + name + Main.storyboard + path + SwaggerClient/Main.storyboard + sourceTree + <group> + + B2ADCA62DE4AC0F5BAB42208 + + children + + B2ADC2F3483B3117A00FA91C + B2ADC55130D5E329ED945E8F + + isa + PBXGroup + path + Helpers + sourceTree + <group> + + BFB4BE760737508B3CFC23B2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-SwaggerClient_Example.release.xcconfig + path + Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig + sourceTree + <group> + + CCE77F10C6D41F74B075ECD0 + + children + + E445A633FA767F207D7EE6CE + BFB4BE760737508B3CFC23B2 + 73CCD82196AABD64F2807C7B + 1A81C3BE3E54961CD827EAE3 + + isa + PBXGroup + name + Pods + sourceTree + <group> + + CF0ADB471B5F95D6008A2729 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + PetTest.m + sourceTree + <group> + + CF0ADB481B5F95D6008A2729 + + fileRef + CF0ADB471B5F95D6008A2729 + isa + PBXBuildFile + + CF8F71381B5F73AC00162980 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + DeserializationTest.m + sourceTree + <group> + + CF8F71391B5F73AC00162980 + + fileRef + CF8F71381B5F73AC00162980 + isa + PBXBuildFile + + CFDFB40A1B3CFEC3009739C5 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + PetApiTest.m + sourceTree + <group> + + CFDFB40B1B3CFEC3009739C5 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + StoreApiTest.m + sourceTree + <group> + + CFDFB40C1B3CFEC3009739C5 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SWGApiClientTest.m + sourceTree + <group> + + CFDFB40D1B3CFEC3009739C5 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + UserApiTest.m + sourceTree + <group> + + CFDFB4121B3CFFA8009739C5 + + fileRef + CFDFB40D1B3CFEC3009739C5 + isa + PBXBuildFile + + CFDFB4131B3CFFDD009739C5 + + fileRef + CFDFB40A1B3CFEC3009739C5 + isa + PBXBuildFile + + CFDFB4141B3CFFF6009739C5 + + fileRef + CFDFB40B1B3CFEC3009739C5 + isa + PBXBuildFile + + CFDFB4151B3D000B009739C5 + + fileRef + CFDFB40C1B3CFEC3009739C5 + isa + PBXBuildFile + + DA8DD6AAE903F2CD38F2D9D5 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-frameworks.sh" + + showEnvVarsInLog + 0 + + E337D7E459CCFFDF27046FFC + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + 📦 Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh" + + showEnvVarsInLog + 0 + + E445A633FA767F207D7EE6CE + + includeInIndex + 1 + isa + PBXFileReference + 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 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + name + SwaggerClient.podspec + path + ../SwaggerClient.podspec + sourceTree + <group> + + FD42985CC653969FE997DEC9 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh" + + showEnvVarsInLog + 0 + + FDEF5BA3CF9CFFDEB5A47DB4 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-SwaggerClient_Tests.a + sourceTree + BUILT_PRODUCTS_DIR + + + rootObject + 6003F582195388D10070C39A + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m index 7f8e3d67881b..d1ee531e2f05 100644 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m @@ -10,7 +10,7 @@ #import #import #import -#import +#import @interface SWGViewController () @@ -22,7 +22,7 @@ { [super viewDidLoad]; - SWGConfiguration *config = [SWGConfiguration sharedConfig]; + SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; config.debug = YES; SWGPetApi *api = [[SWGPetApi alloc] init]; diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m index 335e4f50bb2e..7e78cae48405 100644 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m @@ -2,6 +2,9 @@ #import #import #import +#import +#import +#import @interface SWGApiClientTest : XCTestCase @@ -86,7 +89,7 @@ } - (void)testConfiguration { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; + SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; [config setApiKey:@"123456" forApiKeyIdentifier:@"api_key"]; [config setApiKeyPrefix:@"PREFIX" forApiKeyPrefixIdentifier:@"api_key"]; config.username = @"test_username"; @@ -113,7 +116,7 @@ } - (void)testGetBasicAuthToken { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; + SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; config.username = @"test_username"; config.password = @"test_password"; diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md index 92fb2c4de81b..bfeaacfa366a 100644 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **addPet** ```objc --(NSNumber*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -26,7 +26,7 @@ Add a new pet to the store ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; @@ -68,7 +68,7 @@ void (empty response body) # **deletePet** ```objc --(NSNumber*) deletePetWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler; ``` @@ -79,7 +79,7 @@ Deletes a pet ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; @@ -124,7 +124,7 @@ void (empty response body) # **findPetsByStatus** ```objc --(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler; ``` @@ -134,7 +134,7 @@ Multiple status values can be provided with comma seperated strings ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; @@ -179,7 +179,7 @@ Name | Type | Description | Notes # **findPetsByTags** ```objc --(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler; ``` @@ -189,7 +189,7 @@ Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; @@ -234,7 +234,7 @@ Name | Type | Description | Notes # **getPetById** ```objc --(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; ``` @@ -244,16 +244,16 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; // Configure API key authorization: (authentication scheme: api_key) [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - NSNumber* petId = @789; // ID of pet that needs to be fetched @@ -283,7 +283,7 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) +[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) ### HTTP request headers @@ -294,7 +294,7 @@ Name | Type | Description | Notes # **updatePet** ```objc --(NSNumber*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -304,7 +304,7 @@ Update an existing pet ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; @@ -346,7 +346,7 @@ void (empty response body) # **updatePetWithForm** ```objc --(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler; @@ -358,7 +358,7 @@ Updates a pet in the store with form data ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; @@ -406,7 +406,7 @@ void (empty response body) # **uploadFile** ```objc --(NSNumber*) uploadFileWithPetId: (NSNumber*) petId +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file completionHandler: (void (^)(NSError* error)) handler; @@ -418,7 +418,7 @@ uploads an image ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md index 12bcef79a409..3124b5c64586 100644 --- a/samples/client/petstore/objc/default/docs/SWGStoreApi.md +++ b/samples/client/petstore/objc/default/docs/SWGStoreApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **deleteOrder** ```objc --(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler; ``` @@ -59,7 +59,7 @@ No authorization required # **getInventory** ```objc --(NSNumber*) getInventoryWithCompletionHandler: +-(NSURLSessionTask*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler; ``` @@ -69,7 +69,7 @@ Returns a map of status codes to quantities ### Example ```objc -SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure API key authorization: (authentication scheme: api_key) [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; @@ -112,7 +112,7 @@ This endpoint does not need any parameter. # **getOrderById** ```objc --(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; ``` @@ -162,7 +162,7 @@ No authorization required # **placeOrder** ```objc --(NSNumber*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; ``` diff --git a/samples/client/petstore/objc/default/docs/SWGUserApi.md b/samples/client/petstore/objc/default/docs/SWGUserApi.md index c7a62f3b3c48..bffba171129f 100644 --- a/samples/client/petstore/objc/default/docs/SWGUserApi.md +++ b/samples/client/petstore/objc/default/docs/SWGUserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** ```objc --(NSNumber*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -63,7 +63,7 @@ No authorization required # **createUsersWithArrayInput** ```objc --(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -110,7 +110,7 @@ No authorization required # **createUsersWithListInput** ```objc --(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -157,7 +157,7 @@ No authorization required # **deleteUser** ```objc --(NSNumber*) deleteUserWithUsername: (NSString*) username +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler; ``` @@ -204,7 +204,7 @@ No authorization required # **getUserByName** ```objc --(NSNumber*) getUserByNameWithUsername: (NSString*) username +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; ``` @@ -254,7 +254,7 @@ No authorization required # **loginUser** ```objc --(NSNumber*) loginUserWithUsername: (NSString*) username +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler; ``` @@ -308,7 +308,7 @@ No authorization required # **logoutUser** ```objc --(NSNumber*) logoutUserWithCompletionHandler: +-(NSURLSessionTask*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler; ``` @@ -351,7 +351,7 @@ No authorization required # **updateUser** ```objc --(NSNumber*) updateUserWithUsername: (NSString*) username +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; ```