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 142e14a9e80..18b756f78b0 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache @@ -2,6 +2,10 @@ NSString *const {{classPrefix}}ResponseObjectErrorKey = @"{{classPrefix}}ResponseObject"; +NSString *const {{classPrefix}}DeserializationErrorDomainKey = @"{{classPrefix}}DeserializationErrorDomainKey"; + +NSInteger const {{classPrefix}}TypeMismatchErrorCode = 143553; + static long requestId = 0; static bool offlineState = false; static NSMutableSet * queuedRequests = nil; @@ -288,13 +292,7 @@ static void (^reachabilityChangeBlock)(int); #pragma mark - Deserialize methods -- (id) deserialize:(id) data class:(NSString *) class { - NSRegularExpression *regexp = nil; - NSTextCheckingResult *match = nil; - NSMutableArray *resultArray = nil; - NSMutableDictionary *resultDict = nil; - NSString *innerType = nil; - +- (id) deserialize:(id) data class:(NSString *) class error:(NSError **) error { // return nil if data is nil or class is nil if (!data || !class) { return nil; @@ -310,6 +308,12 @@ static void (^reachabilityChangeBlock)(int); return data; } + NSRegularExpression *regexp = nil; + NSTextCheckingResult *match = nil; + NSMutableArray *resultArray = nil; + NSMutableDictionary *resultDict = nil; + NSString *innerType = nil; + // list of models NSString *arrayOfModelsPat = @"NSArray<(.+)>"; regexp = [NSRegularExpression regularExpressionWithPattern:arrayOfModelsPat @@ -321,14 +325,25 @@ static void (^reachabilityChangeBlock)(int); range:NSMakeRange(0, [class length])]; if (match) { + if(![data isKindOfClass: [NSArray class]]) { + if(error) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : NSLocalizedString(@"Received response is not an array", nil)}; + *error = [NSError errorWithDomain:{{classPrefix}}DeserializationErrorDomainKey code:{{classPrefix}}TypeMismatchErrorCode userInfo:userInfo]; + } + return nil; + } NSArray *dataArray = data; innerType = [class substringWithRange:[match rangeAtIndex:1]]; resultArray = [NSMutableArray arrayWithCapacity:[dataArray count]]; [data enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [resultArray addObject:[self deserialize:obj class:innerType]]; + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else { + * stop = YES; } - ]; + }]; return resultArray; } @@ -348,7 +363,12 @@ static void (^reachabilityChangeBlock)(int); resultArray = [NSMutableArray arrayWithCapacity:[dataArray count]]; [data enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [resultArray addObject:[self deserialize:obj class:innerType]]; + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else { + * stop = YES; + } }]; return resultArray; @@ -369,7 +389,12 @@ static void (^reachabilityChangeBlock)(int); resultDict = [NSMutableDictionary dictionaryWithCapacity:[dataDict count]]; [data enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [resultDict setValue:[self deserialize:obj class:valueType] forKey:key]; + id dicObj = [self deserialize:obj class:valueType error:error]; + if(dicObj) { + [resultDict setValue:dicObj forKey:key]; + } else { + * stop = YES; + } }]; return resultDict; @@ -407,7 +432,7 @@ static void (^reachabilityChangeBlock)(int); // model Class ModelClass = NSClassFromString(class); if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { - return [[ModelClass alloc] initWithDictionary:data error:nil]; + return [(JSONModel *) [ModelClass alloc] initWithDictionary:data error:error]; } return nil; @@ -635,7 +660,12 @@ static void (^reachabilityChangeBlock)(int); } else { [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { - completionBlock([self deserialize:data class:responseType], error); + NSError * serializationError; + id response = [self deserialize:data class:responseType error:&serializationError]; + if(!response && !error){ + error = serializationError; + } + completionBlock(response, error); }]; } return requestId; 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 a039e7e168e..1cf3db5e523 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache @@ -25,6 +25,16 @@ */ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; +/** + * A key for deserialization ErrorDomain + */ +extern NSString *const {{classPrefix}}DeserializationErrorDomainKey; + +/** + * Code for deserialization type mismatch error + */ +extern NSInteger const {{classPrefix}}TypeMismatchErrorCode; + /** * Log debug message macro */ @@ -171,8 +181,9 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; * * @param data The data will be deserialized. * @param class The type of objective-c object. + * @param error The error */ -- (id) deserialize:(id) data class:(NSString *) class; +- (id) deserialize:(id) data class:(NSString *) class error:(NSError**)error; /** * Logs request and response diff --git a/samples/client/petstore/objc/README.md b/samples/client/petstore/objc/README.md index 5223de2bc98..bd0f24851a7 100644 --- a/samples/client/petstore/objc/README.md +++ b/samples/client/petstore/objc/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-04-12T15:30:12.334+08:00 +- Build date: 2016-04-25T18:52:19.055+02:00 - Build package: class io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -41,18 +41,9 @@ Import the following: #import #import // load models -#import -#import -#import #import -#import -#import -#import -#import #import #import -#import -#import #import #import // load API classes for accessing endpoints @@ -107,20 +98,15 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*SWGPetApi* | [**addPetUsingByteArray**](docs/SWGPetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store *SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status *SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags *SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*SWGPetApi* | [**getPetByIdInObject**](docs/SWGPetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -*SWGPetApi* | [**petPetIdtestingByteArraytrueGet**](docs/SWGPetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' *SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet *SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image *SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*SWGStoreApi* | [**findOrdersByStatus**](docs/SWGStoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status *SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*SWGStoreApi* | [**getInventoryInObject**](docs/SWGStoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' *SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID *SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user @@ -135,18 +121,9 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [SWG200Response](docs/SWG200Response.md) - - [SWGAnimal](docs/SWGAnimal.md) - - [SWGCat](docs/SWGCat.md) - [SWGCategory](docs/SWGCategory.md) - - [SWGDog](docs/SWGDog.md) - - [SWGFormatTest](docs/SWGFormatTest.md) - - [SWGInlineResponse200](docs/SWGInlineResponse200.md) - - [SWGName](docs/SWGName.md) - [SWGOrder](docs/SWGOrder.md) - [SWGPet](docs/SWGPet.md) - - [SWGReturn](docs/SWGReturn.md) - - [SWGSpecialModelName_](docs/SWGSpecialModelName_.md) - [SWGTag](docs/SWGTag.md) - [SWGUser](docs/SWGUser.md) @@ -154,11 +131,14 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## test_api_key_header +## petstore_auth -- **Type**: API key -- **API key parameter name**: test_api_key_header -- **Location**: HTTP header +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets ## api_key @@ -166,40 +146,9 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header -## test_http_basic - -- **Type**: HTTP basic authentication - -## test_api_client_secret - -- **Type**: API key -- **API key parameter name**: x-test_api_client_secret -- **Location**: HTTP header - -## test_api_client_id - -- **Type**: API key -- **API key parameter name**: x-test_api_client_id -- **Location**: HTTP header - -## test_api_key_query - -- **Type**: API key -- **API key parameter name**: test_api_key_query -- **Location**: URL query string - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - ## Author -apiteam@swagger.io +apiteam@wordnik.com diff --git a/samples/client/petstore/objc/SwaggerClient/SWGApiClient.h b/samples/client/petstore/objc/SwaggerClient/SWGApiClient.h index af299ff0008..5d40ef2f5f0 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGApiClient.h +++ b/samples/client/petstore/objc/SwaggerClient/SWGApiClient.h @@ -12,18 +12,9 @@ * Do not edit the class manually. */ -#import "SWG200Response.h" -#import "SWGAnimal.h" -#import "SWGCat.h" #import "SWGCategory.h" -#import "SWGDog.h" -#import "SWGFormatTest.h" -#import "SWGInlineResponse200.h" -#import "SWGName.h" #import "SWGOrder.h" #import "SWGPet.h" -#import "SWGReturn.h" -#import "SWGSpecialModelName_.h" #import "SWGTag.h" #import "SWGUser.h" @@ -38,6 +29,16 @@ */ extern NSString *const SWGResponseObjectErrorKey; +/** + * A key for deserialization ErrorDomain + */ +extern NSString *const SWGDeserializationErrorDomainKey; + +/** + * Code for deserialization type mismatch error + */ +extern NSInteger const SWGTypeMismatchErrorCode; + /** * Log debug message macro */ @@ -184,8 +185,9 @@ extern NSString *const SWGResponseObjectErrorKey; * * @param data The data will be deserialized. * @param class The type of objective-c object. + * @param error The error */ -- (id) deserialize:(id) data class:(NSString *) class; +- (id) deserialize:(id) data class:(NSString *) class error:(NSError**)error; /** * Logs request and response diff --git a/samples/client/petstore/objc/SwaggerClient/SWGApiClient.m b/samples/client/petstore/objc/SwaggerClient/SWGApiClient.m index 0c8f21d3ae7..ecdf4aaafb2 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGApiClient.m +++ b/samples/client/petstore/objc/SwaggerClient/SWGApiClient.m @@ -2,6 +2,10 @@ NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; +NSString *const SWGDeserializationErrorDomainKey = @"SWGDeserializationErrorDomainKey"; + +NSInteger const SWGTypeMismatchErrorCode = 143553; + static long requestId = 0; static bool offlineState = false; static NSMutableSet * queuedRequests = nil; @@ -288,13 +292,7 @@ static void (^reachabilityChangeBlock)(int); #pragma mark - Deserialize methods -- (id) deserialize:(id) data class:(NSString *) class { - NSRegularExpression *regexp = nil; - NSTextCheckingResult *match = nil; - NSMutableArray *resultArray = nil; - NSMutableDictionary *resultDict = nil; - NSString *innerType = nil; - +- (id) deserialize:(id) data class:(NSString *) class error:(NSError **) error { // return nil if data is nil or class is nil if (!data || !class) { return nil; @@ -310,6 +308,12 @@ static void (^reachabilityChangeBlock)(int); return data; } + NSRegularExpression *regexp = nil; + NSTextCheckingResult *match = nil; + NSMutableArray *resultArray = nil; + NSMutableDictionary *resultDict = nil; + NSString *innerType = nil; + // list of models NSString *arrayOfModelsPat = @"NSArray<(.+)>"; regexp = [NSRegularExpression regularExpressionWithPattern:arrayOfModelsPat @@ -321,14 +325,25 @@ static void (^reachabilityChangeBlock)(int); range:NSMakeRange(0, [class length])]; if (match) { + if(![data isKindOfClass: [NSArray class]]) { + if(error) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : NSLocalizedString(@"Received response is not an array", nil)}; + *error = [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGTypeMismatchErrorCode userInfo:userInfo]; + } + return nil; + } NSArray *dataArray = data; innerType = [class substringWithRange:[match rangeAtIndex:1]]; resultArray = [NSMutableArray arrayWithCapacity:[dataArray count]]; [data enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [resultArray addObject:[self deserialize:obj class:innerType]]; + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else { + * stop = YES; } - ]; + }]; return resultArray; } @@ -348,7 +363,12 @@ static void (^reachabilityChangeBlock)(int); resultArray = [NSMutableArray arrayWithCapacity:[dataArray count]]; [data enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [resultArray addObject:[self deserialize:obj class:innerType]]; + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else { + * stop = YES; + } }]; return resultArray; @@ -369,7 +389,12 @@ static void (^reachabilityChangeBlock)(int); resultDict = [NSMutableDictionary dictionaryWithCapacity:[dataDict count]]; [data enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [resultDict setValue:[self deserialize:obj class:valueType] forKey:key]; + id dicObj = [self deserialize:obj class:valueType error:error]; + if(dicObj) { + [resultDict setValue:dicObj forKey:key]; + } else { + * stop = YES; + } }]; return resultDict; @@ -407,7 +432,7 @@ static void (^reachabilityChangeBlock)(int); // model Class ModelClass = NSClassFromString(class); if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { - return [[ModelClass alloc] initWithDictionary:data error:nil]; + return [(JSONModel *) [ModelClass alloc] initWithDictionary:data error:error]; } return nil; @@ -635,7 +660,12 @@ static void (^reachabilityChangeBlock)(int); } else { [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { - completionBlock([self deserialize:data class:responseType], error); + NSError * serializationError; + id response = [self deserialize:data class:responseType error:&serializationError]; + if(!response && !error){ + error = serializationError; + } + completionBlock(response, error); }]; } return requestId; diff --git a/samples/client/petstore/objc/SwaggerClient/SWGConfiguration.m b/samples/client/petstore/objc/SwaggerClient/SWGConfiguration.m index 0e5b36f4a81..c9d80f5c488 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGConfiguration.m +++ b/samples/client/petstore/objc/SwaggerClient/SWGConfiguration.m @@ -122,12 +122,12 @@ - (NSDictionary *) authSettings { return @{ - @"test_api_key_header": + @"petstore_auth": @{ - @"type": @"api_key", + @"type": @"oauth", @"in": @"header", - @"key": @"test_api_key_header", - @"value": [self getApiKeyWithPrefix:@"test_api_key_header"] + @"key": @"Authorization", + @"value": [self getAccessToken] }, @"api_key": @{ @@ -136,41 +136,6 @@ @"key": @"api_key", @"value": [self getApiKeyWithPrefix:@"api_key"] }, - @"test_http_basic": - @{ - @"type": @"basic", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getBasicAuthToken] - }, - @"test_api_client_secret": - @{ - @"type": @"api_key", - @"in": @"header", - @"key": @"x-test_api_client_secret", - @"value": [self getApiKeyWithPrefix:@"x-test_api_client_secret"] - }, - @"test_api_client_id": - @{ - @"type": @"api_key", - @"in": @"header", - @"key": @"x-test_api_client_id", - @"value": [self getApiKeyWithPrefix:@"x-test_api_client_id"] - }, - @"test_api_key_query": - @{ - @"type": @"api_key", - @"in": @"query", - @"key": @"test_api_key_query", - @"value": [self getApiKeyWithPrefix:@"test_api_key_query"] - }, - @"petstore_auth": - @{ - @"type": @"oauth", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getAccessToken] - }, }; } diff --git a/samples/client/petstore/objc/SwaggerClient/SWGInlineResponse200.h b/samples/client/petstore/objc/SwaggerClient/SWGInlineResponse200.h index aeb69eafa69..577434faae6 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGInlineResponse200.h +++ b/samples/client/petstore/objc/SwaggerClient/SWGInlineResponse200.h @@ -16,17 +16,17 @@ @interface SWGInlineResponse200 : SWGObject -@property(nonatomic) NSArray* tags; +@property(nonatomic) NSArray* /* NSString */ photoUrls; + +@property(nonatomic) NSString* name; @property(nonatomic) NSNumber* _id; @property(nonatomic) NSObject* category; + +@property(nonatomic) NSArray* tags; /* pet status in the store [optional] */ @property(nonatomic) NSString* status; -@property(nonatomic) NSString* name; - -@property(nonatomic) NSArray* /* NSString */ photoUrls; - @end diff --git a/samples/client/petstore/objc/SwaggerClient/SWGInlineResponse200.m b/samples/client/petstore/objc/SwaggerClient/SWGInlineResponse200.m index 5ac2e7b4057..5fbe9ec6ec2 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGInlineResponse200.m +++ b/samples/client/petstore/objc/SwaggerClient/SWGInlineResponse200.m @@ -20,7 +20,7 @@ */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"tags": @"tags", @"id": @"_id", @"category": @"category", @"status": @"status", @"name": @"name", @"photoUrls": @"photoUrls" }]; + return [[JSONKeyMapper alloc] initWithDictionary:@{ @"photoUrls": @"photoUrls", @"name": @"name", @"id": @"_id", @"category": @"category", @"tags": @"tags", @"status": @"status" }]; } /** @@ -30,7 +30,7 @@ */ + (BOOL)propertyIsOptional:(NSString *)propertyName { - NSArray *optionalProperties = @[@"tags", @"category", @"status", @"name", @"photoUrls"]; + NSArray *optionalProperties = @[@"photoUrls", @"name", @"category", @"tags", @"status"]; if ([optionalProperties containsObject:propertyName]) { return YES; diff --git a/samples/client/petstore/objc/SwaggerClient/SWGPetApi.h b/samples/client/petstore/objc/SwaggerClient/SWGPetApi.h index 7f3abaa3949..ef66979613f 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGPetApi.h +++ b/samples/client/petstore/objc/SwaggerClient/SWGPetApi.h @@ -1,6 +1,5 @@ #import #import "SWGPet.h" -#import "SWGInlineResponse200.h" #import "SWGObject.h" #import "SWGApiClient.h" @@ -33,19 +32,6 @@ completionHandler: (void (^)(NSError* error)) handler; -/// -/// -/// Fake endpoint to test byte array in body parameter for adding a new pet to the store -/// -/// -/// @param body Pet object in the form of byte array (optional) -/// -/// -/// @return --(NSNumber*) addPetUsingByteArrayWithBody: (NSString*) body - completionHandler: (void (^)(NSError* error)) handler; - - /// /// /// Deletes a pet @@ -64,9 +50,9 @@ /// /// /// Finds Pets by status -/// Multiple status values can be provided with comma separated strings +/// Multiple status values can be provided with comma seperated strings /// -/// @param status Status values that need to be considered for query (optional) (default to available) +/// @param status Status values that need to be considered for filter (optional) (default to available) /// /// /// @return NSArray* @@ -100,32 +86,6 @@ completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; -/// -/// -/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// -/// @param petId ID of pet that needs to be fetched -/// -/// -/// @return SWGInlineResponse200* --(NSNumber*) getPetByIdInObjectWithPetId: (NSNumber*) petId - completionHandler: (void (^)(SWGInlineResponse200* output, NSError* error)) handler; - - -/// -/// -/// Fake endpoint to test byte array return by 'Find pet by ID' -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// -/// @param petId ID of pet that needs to be fetched -/// -/// -/// @return NSString* --(NSNumber*) petPetIdtestingByteArraytrueGetWithPetId: (NSNumber*) petId - completionHandler: (void (^)(NSString* output, NSError* error)) handler; - - /// /// /// Update an existing pet diff --git a/samples/client/petstore/objc/SwaggerClient/SWGPetApi.m b/samples/client/petstore/objc/SwaggerClient/SWGPetApi.m index 8c7959a8c3f..87201064542 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGPetApi.m +++ b/samples/client/petstore/objc/SwaggerClient/SWGPetApi.m @@ -1,7 +1,6 @@ #import "SWGPetApi.h" #import "SWGQueryParamCollection.h" #import "SWGPet.h" -#import "SWGInlineResponse200.h" @interface SWGPetApi () @@ -132,70 +131,6 @@ static SWGPetApi* singletonAPI = nil; ]; } -/// -/// Fake endpoint to test byte array in body parameter for adding a new pet to the store -/// -/// @param body Pet object in the form of byte array (optional) -/// -/// @returns void -/// --(NSNumber*) addPetUsingByteArrayWithBody: (NSString*) body - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet?testing_byte_array=true"]; - - // remove format in URL if needed - if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) { - [resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"]; - } - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - handler(error); - } - ]; -} - /// /// Deletes a pet /// @@ -277,8 +212,8 @@ static SWGPetApi* singletonAPI = nil; /// /// Finds Pets by status -/// Multiple status values can be provided with comma separated strings -/// @param status Status values that need to be considered for query (optional, default to available) +/// Multiple status values can be provided with comma seperated strings +/// @param status Status values that need to be considered for filter (optional, default to available) /// /// @returns NSArray* /// @@ -456,7 +391,7 @@ static SWGPetApi* singletonAPI = nil; NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"api_key", @"petstore_auth"]; + NSArray *authSettings = @[@"petstore_auth", @"api_key"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; @@ -480,148 +415,6 @@ static SWGPetApi* singletonAPI = nil; ]; } -/// -/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// @param petId ID of pet that needs to be fetched -/// -/// @returns SWGInlineResponse200* -/// --(NSNumber*) getPetByIdInObjectWithPetId: (NSNumber*) petId - completionHandler: (void (^)(SWGInlineResponse200* output, NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - [NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `getPetByIdInObject`"]; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}?response=inline_arbitrary_object"]; - - // remove format in URL if needed - if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) { - [resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"]; - } - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"api_key", @"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGInlineResponse200*" - completionBlock: ^(id data, NSError *error) { - handler((SWGInlineResponse200*)data, error); - } - ]; -} - -/// -/// Fake endpoint to test byte array return by 'Find pet by ID' -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// @param petId ID of pet that needs to be fetched -/// -/// @returns NSString* -/// --(NSNumber*) petPetIdtestingByteArraytrueGetWithPetId: (NSNumber*) petId - completionHandler: (void (^)(NSString* output, NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - [NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `petPetIdtestingByteArraytrueGet`"]; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}?testing_byte_array=true"]; - - // remove format in URL if needed - if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) { - [resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"]; - } - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"api_key", @"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSString*" - completionBlock: ^(id data, NSError *error) { - handler((NSString*)data, error); - } - ]; -} - /// /// Update an existing pet /// diff --git a/samples/client/petstore/objc/SwaggerClient/SWGStoreApi.h b/samples/client/petstore/objc/SwaggerClient/SWGStoreApi.h index 039f07c8df7..0a7bc70864a 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGStoreApi.h +++ b/samples/client/petstore/objc/SwaggerClient/SWGStoreApi.h @@ -32,19 +32,6 @@ completionHandler: (void (^)(NSError* error)) handler; -/// -/// -/// Finds orders by status -/// A single status value can be provided as a string -/// -/// @param status Status value that needs to be considered for query (optional) (default to placed) -/// -/// -/// @return NSArray* --(NSNumber*) findOrdersByStatusWithStatus: (NSString*) status - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - - /// /// /// Returns pet inventories by status @@ -57,18 +44,6 @@ (void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error)) handler; -/// -/// -/// Fake endpoint to test arbitrary object return by 'Get inventory' -/// Returns an arbitrary object which is actually a map of status codes to quantities -/// -/// -/// -/// @return NSObject* --(NSNumber*) getInventoryInObjectWithCompletionHandler: - (void (^)(NSObject* output, NSError* error)) handler; - - /// /// /// Find purchase order by ID diff --git a/samples/client/petstore/objc/SwaggerClient/SWGStoreApi.m b/samples/client/petstore/objc/SwaggerClient/SWGStoreApi.m index af0002db3b3..84cd3a699d0 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGStoreApi.m +++ b/samples/client/petstore/objc/SwaggerClient/SWGStoreApi.m @@ -138,72 +138,6 @@ static SWGStoreApi* singletonAPI = nil; ]; } -/// -/// Finds orders by status -/// A single status value can be provided as a string -/// @param status Status value that needs to be considered for query (optional, default to placed) -/// -/// @returns NSArray* -/// --(NSNumber*) findOrdersByStatusWithStatus: (NSString*) status - completionHandler: (void (^)(NSArray* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/findByStatus"]; - - // remove format in URL if needed - if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) { - [resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"]; - } - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if (status != nil) { - queryParams[@"status"] = status; - } - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"test_api_client_id", @"test_api_client_secret"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSArray*" - completionBlock: ^(id data, NSError *error) { - handler((NSArray*)data, error); - } - ]; -} - /// /// Returns pet inventories by status /// Returns a map of status codes to quantities @@ -265,67 +199,6 @@ static SWGStoreApi* singletonAPI = nil; ]; } -/// -/// Fake endpoint to test arbitrary object return by 'Get inventory' -/// Returns an arbitrary object which is actually a map of status codes to quantities -/// @returns NSObject* -/// --(NSNumber*) getInventoryInObjectWithCompletionHandler: - (void (^)(NSObject* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory?response=arbitrary_object"]; - - // remove format in URL if needed - if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) { - [resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"]; - } - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"api_key"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSObject*" - completionBlock: ^(id data, NSError *error) { - handler((NSObject*)data, error); - } - ]; -} - /// /// Find purchase order by ID /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -373,7 +246,7 @@ static SWGStoreApi* singletonAPI = nil; NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"test_api_key_header", @"test_api_key_query"]; + NSArray *authSettings = @[]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; @@ -436,7 +309,7 @@ static SWGStoreApi* singletonAPI = nil; NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"test_api_client_id", @"test_api_client_secret"]; + NSArray *authSettings = @[]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; diff --git a/samples/client/petstore/objc/SwaggerClient/SWGUserApi.m b/samples/client/petstore/objc/SwaggerClient/SWGUserApi.m index 71e729ef02c..914d1822402 100644 --- a/samples/client/petstore/objc/SwaggerClient/SWGUserApi.m +++ b/samples/client/petstore/objc/SwaggerClient/SWGUserApi.m @@ -306,7 +306,7 @@ static SWGUserApi* singletonAPI = nil; NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"test_http_basic"]; + NSArray *authSettings = @[]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; diff --git a/samples/client/petstore/objc/SwaggerClientTests/Podfile b/samples/client/petstore/objc/SwaggerClientTests/Podfile index ea5cdb0e6e8..22654e6adda 100644 --- a/samples/client/petstore/objc/SwaggerClientTests/Podfile +++ b/samples/client/petstore/objc/SwaggerClientTests/Podfile @@ -1,10 +1,10 @@ source 'https://github.com/CocoaPods/Specs.git' -target 'SwaggerClient_Example', :exclusive => true do +target 'SwaggerClient_Example' do pod "SwaggerClient", :path => "../" end -target 'SwaggerClient_Tests', :exclusive => true do +target 'SwaggerClient_Tests' do pod "SwaggerClient", :path => "../" pod 'Specta' diff --git a/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 867a6811293..f7274144997 100644 --- a/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -15,14 +15,15 @@ 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SWGAppDelegate.m */; }; 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SWGViewController.m */; }; - 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; - 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; }; + 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 */; }; @@ -56,7 +57,6 @@ 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 = ""; }; - 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; 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 = ""; }; @@ -64,8 +64,10 @@ 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 = ""; }; - 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; 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 = ""; }; + 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 = ""; }; @@ -121,6 +123,7 @@ children = ( 6003F58A195388D20070C39A /* SwaggerClient_Example.app */, 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */, + B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */, ); name = Products; sourceTree = ""; @@ -143,10 +146,8 @@ children = ( 6003F59C195388D20070C39A /* SWGAppDelegate.h */, 6003F59D195388D20070C39A /* SWGAppDelegate.m */, - 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 6003F5A5195388D20070C39A /* SWGViewController.h */, 6003F5A6195388D20070C39A /* SWGViewController.m */, - 6003F5A8195388D20070C39A /* Images.xcassets */, 6003F594195388D20070C39A /* Supporting Files */, ); name = "Example for SwaggerClient"; @@ -194,6 +195,8 @@ children = ( E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */, 4CCE21315897B7D544C83242 /* README.md */, + B2ADC7027D4B025ABCA7999F /* Main.storyboard */, + B2ADC65E342ADA697322D68C /* Images.xcassets */, ); name = "Podspec Metadata"; sourceTree = ""; @@ -287,9 +290,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, - 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, + B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */, + B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */, + B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard b/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard new file mode 100644 index 00000000000..36df4e16819 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist b/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist index d617744f3f4..e21b2835ad7 100644 --- a/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist +++ b/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist @@ -2,11 +2,6 @@ - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - CFBundleDevelopmentRegion en CFBundleDisplayName @@ -29,6 +24,13 @@ 1.0 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UILaunchStoryboardName + Launch Screen UIMainStoryboardFile Main UIRequiredDeviceCapabilities diff --git a/samples/client/petstore/objc/SwaggerClientTests/Tests/DeserializationTest.m b/samples/client/petstore/objc/SwaggerClientTests/Tests/DeserializationTest.m index 7b4b348e4d5..5f5d274b4b0 100644 --- a/samples/client/petstore/objc/SwaggerClientTests/Tests/DeserializationTest.m +++ b/samples/client/petstore/objc/SwaggerClientTests/Tests/DeserializationTest.m @@ -26,9 +26,9 @@ [formatter setTimeZone:timezone]; [formatter setDateFormat:@"yyyy-MM-dd"]; NSDate *date = [formatter dateFromString:dateStr]; - - NSDate *deserializedDate = [apiClient deserialize:dateStr class:@"NSDate*"]; - + NSError* error; + NSDate *deserializedDate = [apiClient deserialize:dateStr class:@"NSDate*" error:&error]; + XCTAssertNil(error); XCTAssertEqualWithAccuracy([date timeIntervalSinceReferenceDate], [deserializedDate timeIntervalSinceReferenceDate], 0.001); } @@ -38,30 +38,33 @@ NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; NSDate *dateTime = [formatter dateFromString:dateTimeStr]; - - NSDate *deserializedDateTime = [apiClient deserialize:dateTimeStr class:@"NSDate*"]; - + NSError* error; + NSDate *deserializedDateTime = [apiClient deserialize:dateTimeStr class:@"NSDate*" error:&error]; + XCTAssertNil(error); XCTAssertEqualWithAccuracy([dateTime timeIntervalSinceReferenceDate], [deserializedDateTime timeIntervalSinceReferenceDate], 0.001); } - (void)testDeserializeObject { NSNumber *data = @1; - NSNumber *result = [apiClient deserialize:data class:@"NSObject*"]; - + NSError* error; + NSNumber *result = [apiClient deserialize:data class:@"NSObject*" error:&error]; + XCTAssertNil(error); XCTAssertEqualObjects(data, result); } - (void)testDeserializeString { NSString *data = @"test string"; - NSString *result = [apiClient deserialize:data class:@"NSString*"]; - + NSError* error; + NSString *result = [apiClient deserialize:data class:@"NSString*" error:&error]; + XCTAssertNil(error); XCTAssertTrue([result isEqualToString:data]); } - (void)testDeserializeListOfString { NSArray *data = @[@"test string"]; - NSArray *result = [apiClient deserialize:data class:@"NSArray* /* NSString */"]; - + NSError* error; + NSArray *result = [apiClient deserialize:data class:@"NSArray* /* NSString */" error:&error]; + XCTAssertNil(error); XCTAssertTrue([result isKindOfClass:[NSArray class]]); XCTAssertTrue([result[0] isKindOfClass:[NSString class]]); } @@ -88,8 +91,8 @@ @"status": @"available" }]; - - NSArray *result = [apiClient deserialize:data class:@"NSArray*"]; + NSError* error; + NSArray *result = [apiClient deserialize:data class:@"NSArray*" error:&error]; XCTAssertTrue([result isKindOfClass:[NSArray class]]); XCTAssertTrue([[result firstObject] isKindOfClass:[SWGPet class]]); @@ -119,8 +122,8 @@ } }; - - NSDictionary *result = [apiClient deserialize:data class:@"NSDictionary* /* NSString, SWGPet */"]; + NSError* error; + NSDictionary *result = [apiClient deserialize:data class:@"NSDictionary* /* NSString, SWGPet */" error:&error]; XCTAssertTrue([result isKindOfClass:[NSDictionary class]]); XCTAssertTrue([result[@"pet"] isKindOfClass:[SWGPet class]]); @@ -134,8 +137,8 @@ @"bar": @1 } }; - - NSDictionary *result = [apiClient deserialize:data class:@"NSDictionary* /* NSString, NSDictionary* /* NSString, NSNumber */ */"]; + NSError* error; + NSDictionary *result = [apiClient deserialize:data class:@"NSDictionary* /* NSString, NSDictionary* /* NSString, NSNumber */ */" error:&error]; XCTAssertTrue([result isKindOfClass:[NSDictionary class]]); XCTAssertTrue([result[@"foo"] isKindOfClass:[NSDictionary class]]); @@ -144,8 +147,8 @@ - (void)testDeserializeNestedList { NSArray *data = @[@[@"foo"]]; - - NSArray *result = [apiClient deserialize:data class:@"NSArray* /* NSArray* /* NSString */ */"]; + NSError* error; + NSArray *result = [apiClient deserialize:data class:@"NSArray* /* NSArray* /* NSString */ */" error:&error]; XCTAssertTrue([result isKindOfClass:[NSArray class]]); XCTAssertTrue([result[0] isKindOfClass:[NSArray class]]); @@ -157,11 +160,12 @@ NSNumber *result; data = @"true"; - result = [apiClient deserialize:data class:@"NSNumber*"]; + NSError* error; + result = [apiClient deserialize:data class:@"NSNumber*" error:&error]; XCTAssertTrue([result isEqual:@YES]); data = @"false"; - result = [apiClient deserialize:data class:@"NSNumber*"]; + result = [apiClient deserialize:data class:@"NSNumber*" error:&error]; XCTAssertTrue([result isEqual:@NO]); } diff --git a/samples/client/petstore/objc/docs/SWGCategory.md b/samples/client/petstore/objc/docs/SWGCategory.md new file mode 100644 index 00000000000..93a8d14ecb9 --- /dev/null +++ b/samples/client/petstore/objc/docs/SWGCategory.md @@ -0,0 +1,11 @@ +# SWGCategory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**name** | **NSString*** | | [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) + + diff --git a/samples/client/petstore/objc/docs/SWGOrder.md b/samples/client/petstore/objc/docs/SWGOrder.md new file mode 100644 index 00000000000..b2a9f25eae9 --- /dev/null +++ b/samples/client/petstore/objc/docs/SWGOrder.md @@ -0,0 +1,15 @@ +# SWGOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**petId** | **NSNumber*** | | [optional] +**quantity** | **NSNumber*** | | [optional] +**shipDate** | **NSDate*** | | [optional] +**status** | **NSString*** | Order Status | [optional] +**complete** | **NSNumber*** | | [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) + + diff --git a/samples/client/petstore/objc/docs/SWGPet.md b/samples/client/petstore/objc/docs/SWGPet.md new file mode 100644 index 00000000000..6c7286531f9 --- /dev/null +++ b/samples/client/petstore/objc/docs/SWGPet.md @@ -0,0 +1,15 @@ +# SWGPet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**category** | [**SWGCategory***](SWGCategory.md) | | [optional] +**name** | **NSString*** | | +**photoUrls** | **NSArray* /* NSString */** | | +**tags** | [**NSArray<SWGTag>***](SWGTag.md) | | [optional] +**status** | **NSString*** | pet status in the store | [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) + + diff --git a/samples/client/petstore/objc/docs/SWGPetApi.md b/samples/client/petstore/objc/docs/SWGPetApi.md new file mode 100644 index 00000000000..78a54942c2f --- /dev/null +++ b/samples/client/petstore/objc/docs/SWGPetApi.md @@ -0,0 +1,530 @@ +# SWGPetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +```objc +-(NSNumber*) addPetWithBody: (SWGPet*) body + completionHandler: (void (^)(NSError* error)) handler; +``` + +Add a new pet to the store + + + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) + +@try +{ + SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + + // Add a new pet to the store + [apiInstance addPetWithBody:body + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGPetApi->addPet: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SWGPet***](SWGPet*.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **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) + +# **deletePet** +```objc +-(NSNumber*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler; +``` + +Deletes a pet + + + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @789; // Pet id to delete +NSString* apiKey = @"apiKey_example"; // (optional) + +@try +{ + SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + + // Deletes a pet + [apiInstance deletePetWithPetId:petId + apiKey:apiKey + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGPetApi->deletePet: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| Pet id to delete | + **apiKey** | **NSString***| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **findPetsByStatus** +```objc +-(NSNumber*) findPetsByStatusWithStatus: (NSArray* /* NSString */) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +Finds Pets by status + +Multiple status values can be provided with comma seperated strings + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSArray* /* NSString */ status = @[@"available"]; // Status values that need to be considered for filter (optional) (default to available) + +@try +{ + SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + + // Finds Pets by status + [apiInstance findPetsByStatusWithStatus:status + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGPetApi->findPetsByStatus: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**NSArray* /* NSString */**](NSString*.md)| Status values that need to be considered for filter | [optional] [default to available] + +### Return type + +[**NSArray***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **findPetsByTags** +```objc +-(NSNumber*) findPetsByTagsWithTags: (NSArray* /* NSString */) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +Finds Pets by tags + +Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSArray* /* NSString */ tags = @[@"tags_example"]; // Tags to filter by (optional) + +@try +{ + SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + + // Finds Pets by tags + [apiInstance findPetsByTagsWithTags:tags + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGPetApi->findPetsByTags: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**NSArray* /* NSString */**](NSString*.md)| Tags to filter by | [optional] + +### Return type + +[**NSArray***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getPetById** +```objc +-(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; +``` + +Find pet by ID + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration 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"]; + + +NSNumber* petId = @789; // ID of pet that needs to be fetched + +@try +{ + SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + + // Find pet by ID + [apiInstance getPetByIdWithPetId:petId + completionHandler: ^(SWGPet* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGPetApi->getPetById: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| ID of pet that needs to be fetched | + +### Return type + +[**SWGPet***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **updatePet** +```objc +-(NSNumber*) updatePetWithBody: (SWGPet*) body + completionHandler: (void (^)(NSError* error)) handler; +``` + +Update an existing pet + + + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) + +@try +{ + SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + + // Update an existing pet + [apiInstance updatePetWithBody:body + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGPetApi->updatePet: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SWGPet***](SWGPet*.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **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) + +# **updatePetWithForm** +```objc +-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler; +``` + +Updates a pet in the store with form data + + + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSString* petId = @"petId_example"; // ID of pet that needs to be updated +NSString* name = @"name_example"; // Updated name of the pet (optional) +NSString* status = @"status_example"; // Updated status of the pet (optional) + +@try +{ + SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + + // Updates a pet in the store with form data + [apiInstance updatePetWithFormWithPetId:petId + name:name + status:status + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGPetApi->updatePetWithForm: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSString***| ID of pet that needs to be updated | + **name** | **NSString***| Updated name of the pet | [optional] + **status** | **NSString***| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **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) + +# **uploadFile** +```objc +-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler; +``` + +uploads an image + + + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @789; // ID of pet to update +NSString* additionalMetadata = @"additionalMetadata_example"; // Additional data to pass to server (optional) +NSURL* file = [NSURL fileURLWithPath:@"/path/to/file.txt"]; // file to upload (optional) + +@try +{ + SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + + // uploads an image + [apiInstance uploadFileWithPetId:petId + additionalMetadata:additionalMetadata + file:file + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGPetApi->uploadFile: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| ID of pet to update | + **additionalMetadata** | **NSString***| Additional data to pass to server | [optional] + **file** | **NSURL***| file to upload | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **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) + diff --git a/samples/client/petstore/objc/docs/SWGStoreApi.md b/samples/client/petstore/objc/docs/SWGStoreApi.md new file mode 100644 index 00000000000..1eacf83431a --- /dev/null +++ b/samples/client/petstore/objc/docs/SWGStoreApi.md @@ -0,0 +1,244 @@ +# SWGStoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +```objc +-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler; +``` + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```objc + +NSString* orderId = @"orderId_example"; // ID of the order that needs to be deleted + +@try +{ + SWGStoreApi *apiInstance = [[SWGStoreApi alloc] init]; + + // Delete purchase order by ID + [apiInstance deleteOrderWithOrderId:orderId + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGStoreApi->deleteOrder: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **NSString***| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getInventory** +```objc +-(NSNumber*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error)) handler; +``` + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```objc +SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; + +// 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"]; + + + +@try +{ + SWGStoreApi *apiInstance = [[SWGStoreApi alloc] init]; + + // Returns pet inventories by status + [apiInstance getInventoryWithCompletionHandler: + ^(NSDictionary* /* NSString, NSNumber */ output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGStoreApi->getInventory: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**NSDictionary* /* NSString, NSNumber */**](NSDictionary.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getOrderById** +```objc +-(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; +``` + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```objc + +NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched + +@try +{ + SWGStoreApi *apiInstance = [[SWGStoreApi alloc] init]; + + // Find purchase order by ID + [apiInstance getOrderByIdWithOrderId:orderId + completionHandler: ^(SWGOrder* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGStoreApi->getOrderById: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **NSString***| ID of pet that needs to be fetched | + +### Return type + +[**SWGOrder***](SWGOrder.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **placeOrder** +```objc +-(NSNumber*) placeOrderWithBody: (SWGOrder*) body + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; +``` + +Place an order for a pet + + + +### Example +```objc + +SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) + +@try +{ + SWGStoreApi *apiInstance = [[SWGStoreApi alloc] init]; + + // Place an order for a pet + [apiInstance placeOrderWithBody:body + completionHandler: ^(SWGOrder* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGStoreApi->placeOrder: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SWGOrder***](SWGOrder*.md)| order placed for purchasing the pet | [optional] + +### Return type + +[**SWGOrder***](SWGOrder.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + diff --git a/samples/client/petstore/objc/docs/SWGTag.md b/samples/client/petstore/objc/docs/SWGTag.md new file mode 100644 index 00000000000..5495d5c8a99 --- /dev/null +++ b/samples/client/petstore/objc/docs/SWGTag.md @@ -0,0 +1,11 @@ +# SWGTag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**name** | **NSString*** | | [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) + + diff --git a/samples/client/petstore/objc/docs/SWGUser.md b/samples/client/petstore/objc/docs/SWGUser.md new file mode 100644 index 00000000000..35bf5540cad --- /dev/null +++ b/samples/client/petstore/objc/docs/SWGUser.md @@ -0,0 +1,17 @@ +# SWGUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**username** | **NSString*** | | [optional] +**firstName** | **NSString*** | | [optional] +**lastName** | **NSString*** | | [optional] +**email** | **NSString*** | | [optional] +**password** | **NSString*** | | [optional] +**phone** | **NSString*** | | [optional] +**userStatus** | **NSNumber*** | User Status | [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) + + diff --git a/samples/client/petstore/objc/docs/SWGUserApi.md b/samples/client/petstore/objc/docs/SWGUserApi.md new file mode 100644 index 00000000000..4fe7a25bccf --- /dev/null +++ b/samples/client/petstore/objc/docs/SWGUserApi.md @@ -0,0 +1,466 @@ +# SWGUserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](SWGUserApi.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +```objc +-(NSNumber*) createUserWithBody: (SWGUser*) body + completionHandler: (void (^)(NSError* error)) handler; +``` + +Create user + +This can only be done by the logged in user. + +### Example +```objc + +SWGUser* body = [[SWGUser alloc] init]; // Created user object (optional) + +@try +{ + SWGUserApi *apiInstance = [[SWGUserApi alloc] init]; + + // Create user + [apiInstance createUserWithBody:body + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGUserApi->createUser: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SWGUser***](SWGUser*.md)| Created user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **createUsersWithArrayInput** +```objc +-(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body + completionHandler: (void (^)(NSError* error)) handler; +``` + +Creates list of users with given input array + + + +### Example +```objc + +NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) + +@try +{ + SWGUserApi *apiInstance = [[SWGUserApi alloc] init]; + + // Creates list of users with given input array + [apiInstance createUsersWithArrayInputWithBody:body + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGUserApi->createUsersWithArrayInput: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **createUsersWithListInput** +```objc +-(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body + completionHandler: (void (^)(NSError* error)) handler; +``` + +Creates list of users with given input array + + + +### Example +```objc + +NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) + +@try +{ + SWGUserApi *apiInstance = [[SWGUserApi alloc] init]; + + // Creates list of users with given input array + [apiInstance createUsersWithListInputWithBody:body + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGUserApi->createUsersWithListInput: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **deleteUser** +```objc +-(NSNumber*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler; +``` + +Delete user + +This can only be done by the logged in user. + +### Example +```objc + +NSString* username = @"username_example"; // The name that needs to be deleted + +@try +{ + SWGUserApi *apiInstance = [[SWGUserApi alloc] init]; + + // Delete user + [apiInstance deleteUserWithUsername:username + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGUserApi->deleteUser: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getUserByName** +```objc +-(NSNumber*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; +``` + +Get user by user name + + + +### Example +```objc + +NSString* username = @"username_example"; // The name that needs to be fetched. Use user1 for testing. + +@try +{ + SWGUserApi *apiInstance = [[SWGUserApi alloc] init]; + + // Get user by user name + [apiInstance getUserByNameWithUsername:username + completionHandler: ^(SWGUser* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGUserApi->getUserByName: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**SWGUser***](SWGUser.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **loginUser** +```objc +-(NSNumber*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler; +``` + +Logs user into the system + + + +### Example +```objc + +NSString* username = @"username_example"; // The user name for login (optional) +NSString* password = @"password_example"; // The password for login in clear text (optional) + +@try +{ + SWGUserApi *apiInstance = [[SWGUserApi alloc] init]; + + // Logs user into the system + [apiInstance loginUserWithUsername:username + password:password + completionHandler: ^(NSString* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGUserApi->loginUser: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The user name for login | [optional] + **password** | **NSString***| The password for login in clear text | [optional] + +### Return type + +**NSString*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **logoutUser** +```objc +-(NSNumber*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler; +``` + +Logs out current logged in user session + + + +### Example +```objc + + +@try +{ + SWGUserApi *apiInstance = [[SWGUserApi alloc] init]; + + // Logs out current logged in user session + [apiInstance logoutUserWithCompletionHandler: + ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGUserApi->logoutUser: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **updateUser** +```objc +-(NSNumber*) updateUserWithUsername: (NSString*) username + body: (SWGUser*) body + completionHandler: (void (^)(NSError* error)) handler; +``` + +Updated user + +This can only be done by the logged in user. + +### Example +```objc + +NSString* username = @"username_example"; // name that need to be deleted +SWGUser* body = [[SWGUser alloc] init]; // Updated user object (optional) + +@try +{ + SWGUserApi *apiInstance = [[SWGUserApi alloc] init]; + + // Updated user + [apiInstance updateUserWithUsername:username + body:body + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +} +@catch (NSException *exception) +{ + NSLog(@"Exception when calling SWGUserApi->updateUser: %@ ", exception.name); + NSLog(@"Reason: %@ ", exception.reason); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| name that need to be deleted | + **body** | [**SWGUser***](SWGUser*.md)| Updated user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) +