From 99cca5d249b28eb484dd5df65ecba43d4dc29bb6 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Tue, 4 Dec 2012 10:20:04 -0800 Subject: [PATCH] updated with latest codegen --- samples/client/petstore/objc/client/NIKPet.h | 8 ++++---- samples/client/petstore/objc/client/NIKPet.m | 12 ++++++------ samples/client/petstore/objc/client/NIKUser.h | 6 +++--- samples/client/petstore/objc/client/NIKUser.m | 10 +++++----- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/samples/client/petstore/objc/client/NIKPet.h b/samples/client/petstore/objc/client/NIKPet.h index c6f0683f7309..7491548570f2 100644 --- a/samples/client/petstore/objc/client/NIKPet.h +++ b/samples/client/petstore/objc/client/NIKPet.h @@ -5,8 +5,8 @@ @interface NIKPet : NIKSwaggerObject { @private - NSNumber* __id; //NSNumber NSArray* _tags; //Tag + NSNumber* __id; //NSNumber NIKCategory* _category; //Category NSString* _status; //NSString NSString* _name; //NSString @@ -15,14 +15,14 @@ -@property(nonatomic) NSNumber* _id; @property(nonatomic) NSArray* tags; +@property(nonatomic) NSNumber* _id; @property(nonatomic) NIKCategory* category; @property(nonatomic) NSString* status; @property(nonatomic) NSString* name; @property(nonatomic) NSArray* photoUrls; -- (id) _id: (NSNumber*) _id - tags: (NSArray*) tags +- (id) tags: (NSArray*) tags + _id: (NSNumber*) _id category: (NIKCategory*) category status: (NSString*) status name: (NSString*) name diff --git a/samples/client/petstore/objc/client/NIKPet.m b/samples/client/petstore/objc/client/NIKPet.m index 26781b5edf08..91e180e56acc 100644 --- a/samples/client/petstore/objc/client/NIKPet.m +++ b/samples/client/petstore/objc/client/NIKPet.m @@ -3,21 +3,21 @@ @implementation NIKPet -@synthesize _id = __id; @synthesize tags = _tags; +@synthesize _id = __id; @synthesize category = _category; @synthesize status = _status; @synthesize name = _name; @synthesize photoUrls = _photoUrls; -- (id) _id: (NSNumber*) _id - tags: (NSArray*) tags +- (id) tags: (NSArray*) tags + _id: (NSNumber*) _id category: (NIKCategory*) category status: (NSString*) status name: (NSString*) name photoUrls: (NSArray*) photoUrls { - __id = _id; _tags = tags; + __id = _id; _category = category; _status = status; _name = name; @@ -27,7 +27,6 @@ - (id) initWithValues: (NSDictionary*)dict { - __id = [dict objectForKey:@"id"]; id tags_dict = [dict objectForKey:@"tags"]; if([tags_dict isKindOfClass:[NSArray class]]) { if([(NSArray*)tags_dict count] > 0) { @@ -39,6 +38,7 @@ _tags = [[NSArray alloc] initWithArray:objs]; } } + __id = [dict objectForKey:@"id"]; id category_dict = [dict objectForKey:@"category"]; _category = [[NIKCategory alloc]initWithValues:category_dict]; _status = [dict objectForKey:@"status"]; @@ -49,7 +49,6 @@ -(NSDictionary*) asDictionary { NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; - if(__id != nil) [dict setObject:__id forKey:@"id"]; if(_tags != nil){ if([_tags isKindOfClass:[NSArray class]]){ NSMutableArray * array = [[NSMutableArray alloc] init]; @@ -68,6 +67,7 @@ else { if(_tags != nil) [dict setObject:[(NIKSwaggerObject*)_tags asDictionary]forKey:@"tags"]; } + if(__id != nil) [dict setObject:__id forKey:@"id"]; if(_category != nil){ if([_category isKindOfClass:[NSArray class]]){ NSMutableArray * array = [[NSMutableArray alloc] init]; diff --git a/samples/client/petstore/objc/client/NIKUser.h b/samples/client/petstore/objc/client/NIKUser.h index 3b061d73cdf0..9074f8b2f51c 100644 --- a/samples/client/petstore/objc/client/NIKUser.h +++ b/samples/client/petstore/objc/client/NIKUser.h @@ -5,8 +5,8 @@ @private NSNumber* __id; //NSNumber NSString* _lastName; //NSString - NSString* _username; //NSString NSString* _phone; //NSString + NSString* _username; //NSString NSString* _email; //NSString NSNumber* _userStatus; //NSNumber NSString* _firstName; //NSString @@ -17,16 +17,16 @@ @property(nonatomic) NSNumber* _id; @property(nonatomic) NSString* lastName; -@property(nonatomic) NSString* username; @property(nonatomic) NSString* phone; +@property(nonatomic) NSString* username; @property(nonatomic) NSString* email; @property(nonatomic) NSNumber* userStatus; @property(nonatomic) NSString* firstName; @property(nonatomic) NSString* password; - (id) _id: (NSNumber*) _id lastName: (NSString*) lastName - username: (NSString*) username phone: (NSString*) phone + username: (NSString*) username email: (NSString*) email userStatus: (NSNumber*) userStatus firstName: (NSString*) firstName diff --git a/samples/client/petstore/objc/client/NIKUser.m b/samples/client/petstore/objc/client/NIKUser.m index 8943eb7d8bbb..2302365399e5 100644 --- a/samples/client/petstore/objc/client/NIKUser.m +++ b/samples/client/petstore/objc/client/NIKUser.m @@ -5,16 +5,16 @@ @synthesize _id = __id; @synthesize lastName = _lastName; -@synthesize username = _username; @synthesize phone = _phone; +@synthesize username = _username; @synthesize email = _email; @synthesize userStatus = _userStatus; @synthesize firstName = _firstName; @synthesize password = _password; - (id) _id: (NSNumber*) _id lastName: (NSString*) lastName - username: (NSString*) username phone: (NSString*) phone + username: (NSString*) username email: (NSString*) email userStatus: (NSNumber*) userStatus firstName: (NSString*) firstName @@ -22,8 +22,8 @@ { __id = _id; _lastName = lastName; - _username = username; _phone = phone; + _username = username; _email = email; _userStatus = userStatus; _firstName = firstName; @@ -35,8 +35,8 @@ { __id = [dict objectForKey:@"id"]; _lastName = [dict objectForKey:@"lastName"]; - _username = [dict objectForKey:@"username"]; _phone = [dict objectForKey:@"phone"]; + _username = [dict objectForKey:@"username"]; _email = [dict objectForKey:@"email"]; _userStatus = [dict objectForKey:@"userStatus"]; _firstName = [dict objectForKey:@"firstName"]; @@ -48,8 +48,8 @@ NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; if(__id != nil) [dict setObject:__id forKey:@"id"]; if(_lastName != nil) [dict setObject:_lastName forKey:@"lastName"]; - if(_username != nil) [dict setObject:_username forKey:@"username"]; if(_phone != nil) [dict setObject:_phone forKey:@"phone"]; + if(_username != nil) [dict setObject:_username forKey:@"username"]; if(_email != nil) [dict setObject:_email forKey:@"email"]; if(_userStatus != nil) [dict setObject:_userStatus forKey:@"userStatus"]; if(_firstName != nil) [dict setObject:_firstName forKey:@"firstName"];