Improve objc tests and samples (#6731)

* improve objc tests and samples

* update objc core-data
This commit is contained in:
William Cheng 2020-06-21 18:49:13 +08:00 committed by GitHub
parent 177bd52957
commit 61f0532ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 810 additions and 309 deletions

View File

@ -3,5 +3,6 @@ outputDir: samples/client/petstore/objc/core-data
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.json
templateDir: modules/openapi-generator/src/main/resources/objc
additionalProperties:
classPrefix: SWG
podName: SwaggerClient
coreData: "true"
appName: PetstoreClient

View File

@ -3,4 +3,5 @@ outputDir: samples/client/petstore/objc/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.json
templateDir: modules/openapi-generator/src/main/resources/objc
additionalProperties:
appName: PetstoreClient
classPrefix: SWG
podName: SwaggerClient

View File

@ -35,6 +35,18 @@ SwaggerClient/Model/SWGCategoryManagedObject.h
SwaggerClient/Model/SWGCategoryManagedObject.m
SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h
SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m
SwaggerClient/Model/SWGInlineObject.h
SwaggerClient/Model/SWGInlineObject.m
SwaggerClient/Model/SWGInlineObject1.h
SwaggerClient/Model/SWGInlineObject1.m
SwaggerClient/Model/SWGInlineObject1ManagedObject.h
SwaggerClient/Model/SWGInlineObject1ManagedObject.m
SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h
SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m
SwaggerClient/Model/SWGInlineObjectManagedObject.h
SwaggerClient/Model/SWGInlineObjectManagedObject.m
SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h
SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m
SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion
SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents
SwaggerClient/Model/SWGOrder.h
@ -62,6 +74,8 @@ SwaggerClient/Model/SWGUserManagedObject.m
SwaggerClient/Model/SWGUserManagedObjectBuilder.h
SwaggerClient/Model/SWGUserManagedObjectBuilder.m
docs/SWGCategory.md
docs/SWGInlineObject.md
docs/SWGInlineObject1.md
docs/SWGOrder.md
docs/SWGPet.md
docs/SWGPetApi.md

View File

@ -42,6 +42,8 @@ Import the following:
#import <SwaggerClient/SWGDefaultConfiguration.h>
// load models
#import <SwaggerClient/SWGCategory.h>
#import <SwaggerClient/SWGInlineObject.h>
#import <SwaggerClient/SWGInlineObject1.h>
#import <SwaggerClient/SWGOrder.h>
#import <SwaggerClient/SWGPet.h>
#import <SwaggerClient/SWGTag.h>
@ -69,12 +71,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPetApi *apiInstance = [[SWGPetApi alloc] init];
// Add a new pet to the store
[apiInstance addPetWithBody:body
[apiInstance addPetWithPet:pet
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
@ -114,6 +116,8 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [SWGCategory](docs/SWGCategory.md)
- [SWGInlineObject](docs/SWGInlineObject.md)
- [SWGInlineObject1](docs/SWGInlineObject1.md)
- [SWGOrder](docs/SWGOrder.md)
- [SWGPet](docs/SWGPet.md)
- [SWGTag](docs/SWGTag.md)

View File

@ -26,12 +26,12 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
/// Add a new pet to the store
///
///
/// @param body Pet object that needs to be added to the store (optional)
/// @param pet Pet object that needs to be added to the store (optional)
///
/// code:405 message:"Invalid input"
///
/// @return void
-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler;
@ -92,14 +92,14 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
/// Update an existing pet
///
///
/// @param body Pet object that needs to be added to the store (optional)
/// @param pet Pet object that needs to be added to the store (optional)
///
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found",
/// code:405 message:"Validation exception"
///
/// @return void
-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler;

View File

@ -52,11 +52,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
///
/// Add a new pet to the store
///
/// @param body Pet object that needs to be added to the store (optional)
/// @param pet Pet object that needs to be added to the store (optional)
///
/// @returns void
///
-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
@ -83,7 +83,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = pet;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
@ -363,11 +363,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
///
/// Update an existing pet
///
/// @param body Pet object that needs to be added to the store (optional)
/// @param pet Pet object that needs to be added to the store (optional)
///
/// @returns void
///
-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
@ -394,7 +394,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = pet;
return [self.apiClient requestWithPath: resourcePath
method: @"PUT"

View File

@ -64,13 +64,13 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode;
/// Place an order for a pet
///
///
/// @param body order placed for purchasing the pet (optional)
/// @param order order placed for purchasing the pet (optional)
///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid Order"
///
/// @return SWGOrder*
-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;

View File

@ -240,11 +240,11 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
///
/// Place an order for a pet
///
/// @param body order placed for purchasing the pet (optional)
/// @param order order placed for purchasing the pet (optional)
///
/// @returns SWGOrder*
///
-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"];
@ -263,7 +263,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -271,7 +271,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = order;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"

View File

@ -26,36 +26,36 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
/// Create user
/// This can only be done by the logged in user.
///
/// @param body Created user object (optional)
/// @param user Created user object (optional)
///
/// code:0 message:"successful operation"
///
/// @return void
-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler;
/// Creates list of users with given input array
///
///
/// @param body List of user object (optional)
/// @param user List of user object (optional)
///
/// code:0 message:"successful operation"
///
/// @return void
-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler;
/// Creates list of users with given input array
///
///
/// @param body List of user object (optional)
/// @param user List of user object (optional)
///
/// code:0 message:"successful operation"
///
/// @return void
-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler;
@ -116,14 +116,14 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
/// This can only be done by the logged in user.
///
/// @param username name that need to be deleted
/// @param body Updated user object (optional)
/// @param user Updated user object (optional)
///
/// code:400 message:"Invalid user supplied",
/// code:404 message:"User not found"
///
/// @return void
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body
user: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler;

View File

@ -52,11 +52,11 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
///
/// Create user
/// This can only be done by the logged in user.
/// @param body Created user object (optional)
/// @param user Created user object (optional)
///
/// @returns void
///
-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"];
@ -75,7 +75,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -83,7 +83,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = user;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
@ -107,11 +107,11 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
///
/// Creates list of users with given input array
///
/// @param body List of user object (optional)
/// @param user List of user object (optional)
///
/// @returns void
///
-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"];
@ -130,7 +130,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -138,7 +138,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = user;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
@ -162,11 +162,11 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
///
/// Creates list of users with given input array
///
/// @param body List of user object (optional)
/// @param user List of user object (optional)
///
/// @returns void
///
-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"];
@ -185,7 +185,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -193,7 +193,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = user;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
@ -470,12 +470,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// This can only be done by the logged in user.
/// @param username name that need to be deleted
///
/// @param body Updated user object (optional)
/// @param user Updated user object (optional)
///
/// @returns void
///
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body
user: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'username' is set
if (username == nil) {
@ -508,7 +508,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -516,7 +516,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = user;
return [self.apiClient requestWithPath: resourcePath
method: @"PUT"

View File

@ -0,0 +1,32 @@
#import <Foundation/Foundation.h>
#import "SWGObject.h"
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@protocol SWGInlineObject
@end
@interface SWGInlineObject : SWGObject
/* Updated name of the pet [optional]
*/
@property(nonatomic) NSString* name;
/* Updated status of the pet [optional]
*/
@property(nonatomic) NSString* status;
@end

View File

@ -0,0 +1,34 @@
#import "SWGInlineObject.h"
@implementation SWGInlineObject
- (instancetype)init {
self = [super init];
if (self) {
// initialize property's default value, if any
}
return self;
}
/**
* Maps json key to property name.
* This method is used by `JSONModel`.
*/
+ (JSONKeyMapper *)keyMapper {
return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"name": @"name", @"status": @"status" }];
}
/**
* Indicates whether the property with the given name is optional.
* If `propertyName` is optional, then return `YES`, otherwise return `NO`.
* This method is used by `JSONModel`.
*/
+ (BOOL)propertyIsOptional:(NSString *)propertyName {
NSArray *optionalProperties = @[@"name", @"status"];
return [optionalProperties containsObject:propertyName];
}
@end

View File

@ -0,0 +1,32 @@
#import <Foundation/Foundation.h>
#import "SWGObject.h"
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@protocol SWGInlineObject1
@end
@interface SWGInlineObject1 : SWGObject
/* Additional data to pass to server [optional]
*/
@property(nonatomic) NSString* additionalMetadata;
/* file to upload [optional]
*/
@property(nonatomic) NSURL* file;
@end

View File

@ -0,0 +1,34 @@
#import "SWGInlineObject1.h"
@implementation SWGInlineObject1
- (instancetype)init {
self = [super init];
if (self) {
// initialize property's default value, if any
}
return self;
}
/**
* Maps json key to property name.
* This method is used by `JSONModel`.
*/
+ (JSONKeyMapper *)keyMapper {
return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"additionalMetadata": @"additionalMetadata", @"file": @"file" }];
}
/**
* Indicates whether the property with the given name is optional.
* If `propertyName` is optional, then return `YES`, otherwise return `NO`.
* This method is used by `JSONModel`.
*/
+ (BOOL)propertyIsOptional:(NSString *)propertyName {
NSArray *optionalProperties = @[@"additionalMetadata", @"file"];
return [optionalProperties containsObject:propertyName];
}
@end

View File

@ -0,0 +1,36 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
NS_ASSUME_NONNULL_BEGIN
@interface SWGInlineObject1ManagedObject : NSManagedObject
/* Additional data to pass to server [optional]
*/
@property (nullable, nonatomic, retain) NSString* additionalMetadata;
/* file to upload [optional]
*/
@property (nullable, nonatomic, retain) NSURL* file;
@end
@interface SWGInlineObject1ManagedObject (GeneratedAccessors)
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,12 @@
#import "SWGInlineObject1ManagedObject.h"
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@implementation SWGInlineObject1ManagedObject
@dynamic additionalMetadata;
@dynamic file;
@end

View File

@ -0,0 +1,35 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "SWGInlineObject1ManagedObject.h"
#import "SWGInlineObject1.h"
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@interface SWGInlineObject1ManagedObjectBuilder : NSObject
-(SWGInlineObject1ManagedObject*)createNewSWGInlineObject1ManagedObjectInContext:(NSManagedObjectContext*)context;
-(SWGInlineObject1ManagedObject*)SWGInlineObject1ManagedObjectFromSWGInlineObject1:(SWGInlineObject1*)object context:(NSManagedObjectContext*)context;
-(void)updateSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)object withSWGInlineObject1:(SWGInlineObject1*)object2;
-(SWGInlineObject1*)SWGInlineObject1FromSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj;
-(void)updateSWGInlineObject1:(SWGInlineObject1*)object withSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)object2;
@end

View File

@ -0,0 +1,55 @@
#import "SWGInlineObject1ManagedObjectBuilder.h"
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@implementation SWGInlineObject1ManagedObjectBuilder
-(instancetype)init {
self = [super init];
if (self != nil) {
}
return self;
}
-(SWGInlineObject1ManagedObject*)createNewSWGInlineObject1ManagedObjectInContext:(NSManagedObjectContext*)context {
SWGInlineObject1ManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGInlineObject1ManagedObject class]) inManagedObjectContext:context];
return managedObject;
}
-(SWGInlineObject1ManagedObject*)SWGInlineObject1ManagedObjectFromSWGInlineObject1:(SWGInlineObject1*)object context:(NSManagedObjectContext*)context {
SWGInlineObject1ManagedObject* newSWGInlineObject1 = [self createNewSWGInlineObject1ManagedObjectInContext:context];
[self updateSWGInlineObject1ManagedObject:newSWGInlineObject1 withSWGInlineObject1:object];
return newSWGInlineObject1;
}
-(void)updateSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)managedObject withSWGInlineObject1:(SWGInlineObject1*)object {
if(!managedObject || !object) {
return;
}
NSManagedObjectContext* context = managedObject.managedObjectContext;
managedObject.additionalMetadata = [object.additionalMetadata copy];
managedObject.file = [object.file copy];
}
-(SWGInlineObject1*)SWGInlineObject1FromSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj {
if(!obj) {
return nil;
}
SWGInlineObject1* newSWGInlineObject1 = [[SWGInlineObject1 alloc] init];
[self updateSWGInlineObject1:newSWGInlineObject1 withSWGInlineObject1ManagedObject:obj];
return newSWGInlineObject1;
}
-(void)updateSWGInlineObject1:(SWGInlineObject1*)newSWGInlineObject1 withSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj {
newSWGInlineObject1.additionalMetadata = [obj.additionalMetadata copy];
newSWGInlineObject1.file = [obj.file copy];
}
@end

View File

@ -0,0 +1,36 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
NS_ASSUME_NONNULL_BEGIN
@interface SWGInlineObjectManagedObject : NSManagedObject
/* Updated name of the pet [optional]
*/
@property (nullable, nonatomic, retain) NSString* name;
/* Updated status of the pet [optional]
*/
@property (nullable, nonatomic, retain) NSString* status;
@end
@interface SWGInlineObjectManagedObject (GeneratedAccessors)
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,12 @@
#import "SWGInlineObjectManagedObject.h"
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@implementation SWGInlineObjectManagedObject
@dynamic name;
@dynamic status;
@end

View File

@ -0,0 +1,35 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "SWGInlineObjectManagedObject.h"
#import "SWGInlineObject.h"
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@interface SWGInlineObjectManagedObjectBuilder : NSObject
-(SWGInlineObjectManagedObject*)createNewSWGInlineObjectManagedObjectInContext:(NSManagedObjectContext*)context;
-(SWGInlineObjectManagedObject*)SWGInlineObjectManagedObjectFromSWGInlineObject:(SWGInlineObject*)object context:(NSManagedObjectContext*)context;
-(void)updateSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)object withSWGInlineObject:(SWGInlineObject*)object2;
-(SWGInlineObject*)SWGInlineObjectFromSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj;
-(void)updateSWGInlineObject:(SWGInlineObject*)object withSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)object2;
@end

View File

@ -0,0 +1,55 @@
#import "SWGInlineObjectManagedObjectBuilder.h"
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@implementation SWGInlineObjectManagedObjectBuilder
-(instancetype)init {
self = [super init];
if (self != nil) {
}
return self;
}
-(SWGInlineObjectManagedObject*)createNewSWGInlineObjectManagedObjectInContext:(NSManagedObjectContext*)context {
SWGInlineObjectManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGInlineObjectManagedObject class]) inManagedObjectContext:context];
return managedObject;
}
-(SWGInlineObjectManagedObject*)SWGInlineObjectManagedObjectFromSWGInlineObject:(SWGInlineObject*)object context:(NSManagedObjectContext*)context {
SWGInlineObjectManagedObject* newSWGInlineObject = [self createNewSWGInlineObjectManagedObjectInContext:context];
[self updateSWGInlineObjectManagedObject:newSWGInlineObject withSWGInlineObject:object];
return newSWGInlineObject;
}
-(void)updateSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)managedObject withSWGInlineObject:(SWGInlineObject*)object {
if(!managedObject || !object) {
return;
}
NSManagedObjectContext* context = managedObject.managedObjectContext;
managedObject.name = [object.name copy];
managedObject.status = [object.status copy];
}
-(SWGInlineObject*)SWGInlineObjectFromSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj {
if(!obj) {
return nil;
}
SWGInlineObject* newSWGInlineObject = [[SWGInlineObject alloc] init];
[self updateSWGInlineObject:newSWGInlineObject withSWGInlineObjectManagedObject:obj];
return newSWGInlineObject;
}
-(void)updateSWGInlineObject:(SWGInlineObject*)newSWGInlineObject withSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj {
newSWGInlineObject.name = [obj.name copy];
newSWGInlineObject.status = [obj.status copy];
}
@end

View File

@ -5,6 +5,14 @@
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<entity name="SWGInlineObjectManagedObject" representedClassName="SWGInlineObjectManagedObject" syncable="YES">
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="status" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<entity name="SWGInlineObject1ManagedObject" representedClassName="SWGInlineObject1ManagedObject" syncable="YES">
<attribute name="additionalMetadata" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="file" optional="YES" attributeType="Binary" syncable="YES"/>
</entity>
<entity name="SWGOrderManagedObject" representedClassName="SWGOrderManagedObject" syncable="YES">
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="petId" optional="YES" attributeType="Double" syncable="YES"/>

View File

@ -214,13 +214,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */;
buildPhases = (
841AD69C2F0A6609E3057F05 /* 📦 Check Pods Manifest.lock */,
841AD69C2F0A6609E3057F05 /* [CP] Check Pods Manifest.lock */,
799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */,
6003F586195388D20070C39A /* Sources */,
6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */,
429AF5C69E165ED75311B4B0 /* [CP] Copy Pods Resources */,
183E54C09C54DAEB54B2546F /* [CP] Embed Pods Frameworks */,
FF3F107CF27E0A54D86C49F5 /* 📦 Embed Pods Frameworks */,
DA89ADFB80DCCB6691DED12D /* 📦 Copy Pods Resources */,
);
@ -237,15 +236,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */;
buildPhases = (
E0F523B17966072A199F040E /* 📦 Check Pods Manifest.lock */,
E0F523B17966072A199F040E /* [CP] Check Pods Manifest.lock */,
7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */,
6003F5AA195388D20070C39A /* Sources */,
6003F5AB195388D20070C39A /* Frameworks */,
6003F5AC195388D20070C39A /* Resources */,
E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */,
111D7956304BD6E860AA8709 /* [CP] Embed Pods Frameworks */,
AA7CAD658C61D6EBA222B5F8 /* 📦 Embed Pods Frameworks */,
E994E0232EFD15F8EE665A4D /* 📦 Copy Pods Resources */,
E994E0232EFD15F8EE665A4D /* Embed Pods Frameworks */,
);
buildRules = (
);
@ -309,49 +307,24 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
111D7956304BD6E860AA8709 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] 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 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] 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 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh",
"${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld",
"${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.momd",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.mom",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */ = {
@ -384,19 +357,22 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
841AD69C2F0A6609E3057F05 /* 📦 Check Pods Manifest.lock */ = {
841AD69C2F0A6609E3057F05 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Example-checkManifestLockResult.txt",
);
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";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
AA7CAD658C61D6EBA222B5F8 /* 📦 Embed Pods Frameworks */ = {
@ -429,19 +405,22 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E0F523B17966072A199F040E /* 📦 Check Pods Manifest.lock */ = {
E0F523B17966072A199F040E /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Tests-checkManifestLockResult.txt",
);
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";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */ = {
@ -450,16 +429,21 @@
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh",
"${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld",
"${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.momd",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.mom",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E994E0232EFD15F8EE665A4D /* 📦 Copy Pods Resources */ = {
E994E0232EFD15F8EE665A4D /* Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -474,21 +458,6 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] 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;
};
FF3F107CF27E0A54D86C49F5 /* 📦 Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;

View File

@ -1,3 +1,3 @@
#!/bin/sh
pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 5s,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]}
pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]}

View File

@ -0,0 +1,11 @@
# SWGInlineObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **NSString*** | Updated name of the pet | [optional]
**status** | **NSString*** | Updated status of the pet | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# SWGInlineObject1
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additionalMetadata** | **NSString*** | Additional data to pass to server | [optional]
**file** | **NSURL*** | file to upload | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
# **addPet**
```objc
-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler;
```
@ -30,12 +30,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
// Add a new pet to the store
[apiInstance addPetWithBody:body
[apiInstance addPetWithPet:pet
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGPetApi->addPet: %@", error);
@ -47,7 +47,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
**pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
### Return type
@ -290,7 +290,7 @@ Name | Type | Description | Notes
# **updatePet**
```objc
-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler;
```
@ -304,12 +304,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
// Update an existing pet
[apiInstance updatePetWithBody:body
[apiInstance updatePetWithPet:pet
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGPetApi->updatePet: %@", error);
@ -321,7 +321,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
**pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
### Return type

View File

@ -162,7 +162,7 @@ No authorization required
# **placeOrder**
```objc
-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
```
@ -171,12 +171,12 @@ Place an order for a pet
### Example
```objc
SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional)
SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional)
SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
// Place an order for a pet
[apiInstance placeOrderWithBody:body
[apiInstance placeOrderWithOrder:order
completionHandler: ^(SWGOrder* output, NSError* error) {
if (output) {
NSLog(@"%@", output);
@ -191,7 +191,7 @@ SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional]
**order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional]
### Return type
@ -203,7 +203,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/json, application/xml
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
# **createUser**
```objc
-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler;
```
@ -27,12 +27,12 @@ This can only be done by the logged in user.
### Example
```objc
SWGUser* body = [[SWGUser alloc] init]; // Created user object (optional)
SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional)
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
// Create user
[apiInstance createUserWithBody:body
[apiInstance createUserWithUser:user
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGUserApi->createUser: %@", error);
@ -44,7 +44,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SWGUser***](SWGUser.md)| Created user object | [optional]
**user** | [**SWGUser***](SWGUser.md)| Created user object | [optional]
### Return type
@ -56,14 +56,14 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **createUsersWithArrayInput**
```objc
-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler;
```
@ -72,12 +72,12 @@ Creates list of users with given input array
### Example
```objc
NSArray<SWGUser>* body = @[[[SWGUser alloc] init]]; // List of user object (optional)
NSArray<SWGUser>* user = @[[[SWGUser alloc] init]]; // List of user object (optional)
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
// Creates list of users with given input array
[apiInstance createUsersWithArrayInputWithBody:body
[apiInstance createUsersWithArrayInputWithUser:user
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error);
@ -89,7 +89,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**NSArray&lt;SWGUser&gt;***](SWGUser.md)| List of user object | [optional]
**user** | [**NSArray&lt;SWGUser&gt;***](SWGUser.md)| List of user object | [optional]
### Return type
@ -101,14 +101,14 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **createUsersWithListInput**
```objc
-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler;
```
@ -117,12 +117,12 @@ Creates list of users with given input array
### Example
```objc
NSArray<SWGUser>* body = @[[[SWGUser alloc] init]]; // List of user object (optional)
NSArray<SWGUser>* user = @[[[SWGUser alloc] init]]; // List of user object (optional)
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
// Creates list of users with given input array
[apiInstance createUsersWithListInputWithBody:body
[apiInstance createUsersWithListInputWithUser:user
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error);
@ -134,7 +134,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**NSArray&lt;SWGUser&gt;***](SWGUser.md)| List of user object | [optional]
**user** | [**NSArray&lt;SWGUser&gt;***](SWGUser.md)| List of user object | [optional]
### Return type
@ -146,7 +146,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -342,7 +342,7 @@ No authorization required
# **updateUser**
```objc
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body
user: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler;
```
@ -354,13 +354,13 @@ This can only be done by the logged in user.
```objc
NSString* username = @"username_example"; // name that need to be deleted
SWGUser* body = [[SWGUser alloc] init]; // Updated user object (optional)
SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional)
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
// Updated user
[apiInstance updateUserWithUsername:username
body:body
user:user
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGUserApi->updateUser: %@", error);
@ -373,7 +373,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **NSString***| name that need to be deleted |
**body** | [**SWGUser***](SWGUser.md)| Updated user object | [optional]
**user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional]
### Return type
@ -385,7 +385,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -31,6 +31,10 @@ SwaggerClient/Core/SWGSanitizer.h
SwaggerClient/Core/SWGSanitizer.m
SwaggerClient/Model/SWGCategory.h
SwaggerClient/Model/SWGCategory.m
SwaggerClient/Model/SWGInlineObject.h
SwaggerClient/Model/SWGInlineObject.m
SwaggerClient/Model/SWGInlineObject1.h
SwaggerClient/Model/SWGInlineObject1.m
SwaggerClient/Model/SWGOrder.h
SwaggerClient/Model/SWGOrder.m
SwaggerClient/Model/SWGPet.h
@ -40,6 +44,8 @@ SwaggerClient/Model/SWGTag.m
SwaggerClient/Model/SWGUser.h
SwaggerClient/Model/SWGUser.m
docs/SWGCategory.md
docs/SWGInlineObject.md
docs/SWGInlineObject1.md
docs/SWGOrder.md
docs/SWGPet.md
docs/SWGPetApi.md

View File

@ -42,6 +42,8 @@ Import the following:
#import <SwaggerClient/SWGDefaultConfiguration.h>
// load models
#import <SwaggerClient/SWGCategory.h>
#import <SwaggerClient/SWGInlineObject.h>
#import <SwaggerClient/SWGInlineObject1.h>
#import <SwaggerClient/SWGOrder.h>
#import <SwaggerClient/SWGPet.h>
#import <SwaggerClient/SWGTag.h>
@ -69,12 +71,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPetApi *apiInstance = [[SWGPetApi alloc] init];
// Add a new pet to the store
[apiInstance addPetWithBody:body
[apiInstance addPetWithPet:pet
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
@ -114,6 +116,8 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [SWGCategory](docs/SWGCategory.md)
- [SWGInlineObject](docs/SWGInlineObject.md)
- [SWGInlineObject1](docs/SWGInlineObject1.md)
- [SWGOrder](docs/SWGOrder.md)
- [SWGPet](docs/SWGPet.md)
- [SWGTag](docs/SWGTag.md)

View File

@ -26,12 +26,12 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
/// Add a new pet to the store
///
///
/// @param body Pet object that needs to be added to the store (optional)
/// @param pet Pet object that needs to be added to the store (optional)
///
/// code:405 message:"Invalid input"
///
/// @return void
-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler;
@ -92,14 +92,14 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
/// Update an existing pet
///
///
/// @param body Pet object that needs to be added to the store (optional)
/// @param pet Pet object that needs to be added to the store (optional)
///
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found",
/// code:405 message:"Validation exception"
///
/// @return void
-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler;

View File

@ -52,11 +52,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
///
/// Add a new pet to the store
///
/// @param body Pet object that needs to be added to the store (optional)
/// @param pet Pet object that needs to be added to the store (optional)
///
/// @returns void
///
-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
@ -83,7 +83,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = pet;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
@ -363,11 +363,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
///
/// Update an existing pet
///
/// @param body Pet object that needs to be added to the store (optional)
/// @param pet Pet object that needs to be added to the store (optional)
///
/// @returns void
///
-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
@ -394,7 +394,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = pet;
return [self.apiClient requestWithPath: resourcePath
method: @"PUT"

View File

@ -64,13 +64,13 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode;
/// Place an order for a pet
///
///
/// @param body order placed for purchasing the pet (optional)
/// @param order order placed for purchasing the pet (optional)
///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid Order"
///
/// @return SWGOrder*
-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;

View File

@ -240,11 +240,11 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
///
/// Place an order for a pet
///
/// @param body order placed for purchasing the pet (optional)
/// @param order order placed for purchasing the pet (optional)
///
/// @returns SWGOrder*
///
-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"];
@ -263,7 +263,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -271,7 +271,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = order;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"

View File

@ -26,36 +26,36 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
/// Create user
/// This can only be done by the logged in user.
///
/// @param body Created user object (optional)
/// @param user Created user object (optional)
///
/// code:0 message:"successful operation"
///
/// @return void
-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler;
/// Creates list of users with given input array
///
///
/// @param body List of user object (optional)
/// @param user List of user object (optional)
///
/// code:0 message:"successful operation"
///
/// @return void
-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler;
/// Creates list of users with given input array
///
///
/// @param body List of user object (optional)
/// @param user List of user object (optional)
///
/// code:0 message:"successful operation"
///
/// @return void
-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler;
@ -116,14 +116,14 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
/// This can only be done by the logged in user.
///
/// @param username name that need to be deleted
/// @param body Updated user object (optional)
/// @param user Updated user object (optional)
///
/// code:400 message:"Invalid user supplied",
/// code:404 message:"User not found"
///
/// @return void
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body
user: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler;

View File

@ -52,11 +52,11 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
///
/// Create user
/// This can only be done by the logged in user.
/// @param body Created user object (optional)
/// @param user Created user object (optional)
///
/// @returns void
///
-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"];
@ -75,7 +75,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -83,7 +83,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = user;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
@ -107,11 +107,11 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
///
/// Creates list of users with given input array
///
/// @param body List of user object (optional)
/// @param user List of user object (optional)
///
/// @returns void
///
-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"];
@ -130,7 +130,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -138,7 +138,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = user;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
@ -162,11 +162,11 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
///
/// Creates list of users with given input array
///
/// @param body List of user object (optional)
/// @param user List of user object (optional)
///
/// @returns void
///
-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"];
@ -185,7 +185,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -193,7 +193,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = user;
return [self.apiClient requestWithPath: resourcePath
method: @"POST"
@ -470,12 +470,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// This can only be done by the logged in user.
/// @param username name that need to be deleted
///
/// @param body Updated user object (optional)
/// @param user Updated user object (optional)
///
/// @returns void
///
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body
user: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'username' is set
if (username == nil) {
@ -508,7 +508,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]];
// Authentication setting
NSArray *authSettings = @[];
@ -516,7 +516,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
bodyParam = body;
bodyParam = user;
return [self.apiClient requestWithPath: resourcePath
method: @"PUT"

View File

@ -0,0 +1,32 @@
#import <Foundation/Foundation.h>
#import "SWGObject.h"
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@protocol SWGInlineObject
@end
@interface SWGInlineObject : SWGObject
/* Updated name of the pet [optional]
*/
@property(nonatomic) NSString* name;
/* Updated status of the pet [optional]
*/
@property(nonatomic) NSString* status;
@end

View File

@ -0,0 +1,34 @@
#import "SWGInlineObject.h"
@implementation SWGInlineObject
- (instancetype)init {
self = [super init];
if (self) {
// initialize property's default value, if any
}
return self;
}
/**
* Maps json key to property name.
* This method is used by `JSONModel`.
*/
+ (JSONKeyMapper *)keyMapper {
return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"name": @"name", @"status": @"status" }];
}
/**
* Indicates whether the property with the given name is optional.
* If `propertyName` is optional, then return `YES`, otherwise return `NO`.
* This method is used by `JSONModel`.
*/
+ (BOOL)propertyIsOptional:(NSString *)propertyName {
NSArray *optionalProperties = @[@"name", @"status"];
return [optionalProperties containsObject:propertyName];
}
@end

View File

@ -0,0 +1,32 @@
#import <Foundation/Foundation.h>
#import "SWGObject.h"
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@protocol SWGInlineObject1
@end
@interface SWGInlineObject1 : SWGObject
/* Additional data to pass to server [optional]
*/
@property(nonatomic) NSString* additionalMetadata;
/* file to upload [optional]
*/
@property(nonatomic) NSURL* file;
@end

View File

@ -0,0 +1,34 @@
#import "SWGInlineObject1.h"
@implementation SWGInlineObject1
- (instancetype)init {
self = [super init];
if (self) {
// initialize property's default value, if any
}
return self;
}
/**
* Maps json key to property name.
* This method is used by `JSONModel`.
*/
+ (JSONKeyMapper *)keyMapper {
return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"additionalMetadata": @"additionalMetadata", @"file": @"file" }];
}
/**
* Indicates whether the property with the given name is optional.
* If `propertyName` is optional, then return `YES`, otherwise return `NO`.
* This method is used by `JSONModel`.
*/
+ (BOOL)propertyIsOptional:(NSString *)propertyName {
NSArray *optionalProperties = @[@"additionalMetadata", @"file"];
return [optionalProperties containsObject:propertyName];
}
@end

View File

@ -236,9 +236,6 @@
6003F586195388D20070C39A /* Sources */,
6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */,
429AF5C69E165ED75311B4B0 /* [CP] Copy Pods Resources */,
183E54C09C54DAEB54B2546F /* [CP] Embed Pods Frameworks */,
DA8DD6AAE903F2CD38F2D9D5 /* Embed Pods Frameworks */,
);
buildRules = (
);
@ -257,9 +254,6 @@
6003F5AA195388D20070C39A /* Sources */,
6003F5AB195388D20070C39A /* Frameworks */,
6003F5AC195388D20070C39A /* Resources */,
E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */,
111D7956304BD6E860AA8709 /* [CP] Embed Pods Frameworks */,
FD42985CC653969FE997DEC9 /* Embed Pods Frameworks */,
);
buildRules = (
);
@ -323,64 +317,22 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
111D7956304BD6E860AA8709 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] 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 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] 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 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] 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 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */ = {
@ -389,58 +341,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Tests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
DA8DD6AAE903F2CD38F2D9D5 /* 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;
};
E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] 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;
};
FD42985CC653969FE997DEC9 /* 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";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

View File

@ -1,3 +1,3 @@
#!/bin/sh
pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 5s,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]}
pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]}

View File

@ -0,0 +1,11 @@
# SWGInlineObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **NSString*** | Updated name of the pet | [optional]
**status** | **NSString*** | Updated status of the pet | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# SWGInlineObject1
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additionalMetadata** | **NSString*** | Additional data to pass to server | [optional]
**file** | **NSURL*** | file to upload | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
# **addPet**
```objc
-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler;
```
@ -30,12 +30,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
// Add a new pet to the store
[apiInstance addPetWithBody:body
[apiInstance addPetWithPet:pet
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGPetApi->addPet: %@", error);
@ -47,7 +47,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
**pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
### Return type
@ -290,7 +290,7 @@ Name | Type | Description | Notes
# **updatePet**
```objc
-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
completionHandler: (void (^)(NSError* error)) handler;
```
@ -304,12 +304,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
// Update an existing pet
[apiInstance updatePetWithBody:body
[apiInstance updatePetWithPet:pet
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGPetApi->updatePet: %@", error);
@ -321,7 +321,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
**pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
### Return type

View File

@ -162,7 +162,7 @@ No authorization required
# **placeOrder**
```objc
-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
```
@ -171,12 +171,12 @@ Place an order for a pet
### Example
```objc
SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional)
SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional)
SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
// Place an order for a pet
[apiInstance placeOrderWithBody:body
[apiInstance placeOrderWithOrder:order
completionHandler: ^(SWGOrder* output, NSError* error) {
if (output) {
NSLog(@"%@", output);
@ -191,7 +191,7 @@ SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional]
**order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional]
### Return type
@ -203,7 +203,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/json, application/xml
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
# **createUser**
```objc
-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler;
```
@ -27,12 +27,12 @@ This can only be done by the logged in user.
### Example
```objc
SWGUser* body = [[SWGUser alloc] init]; // Created user object (optional)
SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional)
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
// Create user
[apiInstance createUserWithBody:body
[apiInstance createUserWithUser:user
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGUserApi->createUser: %@", error);
@ -44,7 +44,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SWGUser***](SWGUser.md)| Created user object | [optional]
**user** | [**SWGUser***](SWGUser.md)| Created user object | [optional]
### Return type
@ -56,14 +56,14 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **createUsersWithArrayInput**
```objc
-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler;
```
@ -72,12 +72,12 @@ Creates list of users with given input array
### Example
```objc
NSArray<SWGUser>* body = @[[[SWGUser alloc] init]]; // List of user object (optional)
NSArray<SWGUser>* user = @[[[SWGUser alloc] init]]; // List of user object (optional)
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
// Creates list of users with given input array
[apiInstance createUsersWithArrayInputWithBody:body
[apiInstance createUsersWithArrayInputWithUser:user
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error);
@ -89,7 +89,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**NSArray&lt;SWGUser&gt;***](SWGUser.md)| List of user object | [optional]
**user** | [**NSArray&lt;SWGUser&gt;***](SWGUser.md)| List of user object | [optional]
### Return type
@ -101,14 +101,14 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **createUsersWithListInput**
```objc
-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray<SWGUser>*) user
completionHandler: (void (^)(NSError* error)) handler;
```
@ -117,12 +117,12 @@ Creates list of users with given input array
### Example
```objc
NSArray<SWGUser>* body = @[[[SWGUser alloc] init]]; // List of user object (optional)
NSArray<SWGUser>* user = @[[[SWGUser alloc] init]]; // List of user object (optional)
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
// Creates list of users with given input array
[apiInstance createUsersWithListInputWithBody:body
[apiInstance createUsersWithListInputWithUser:user
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error);
@ -134,7 +134,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**NSArray&lt;SWGUser&gt;***](SWGUser.md)| List of user object | [optional]
**user** | [**NSArray&lt;SWGUser&gt;***](SWGUser.md)| List of user object | [optional]
### Return type
@ -146,7 +146,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -342,7 +342,7 @@ No authorization required
# **updateUser**
```objc
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body
user: (SWGUser*) user
completionHandler: (void (^)(NSError* error)) handler;
```
@ -354,13 +354,13 @@ This can only be done by the logged in user.
```objc
NSString* username = @"username_example"; // name that need to be deleted
SWGUser* body = [[SWGUser alloc] init]; // Updated user object (optional)
SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional)
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
// Updated user
[apiInstance updateUserWithUsername:username
body:body
user:user
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error calling SWGUserApi->updateUser: %@", error);
@ -373,7 +373,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **NSString***| name that need to be deleted |
**body** | [**SWGUser***](SWGUser.md)| Updated user object | [optional]
**user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional]
### Return type
@ -385,7 +385,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)