add method documentation for objc client

This commit is contained in:
William Cheng 2015-04-19 23:41:26 +08:00
parent ae389a8993
commit 3622cfd169
4 changed files with 131 additions and 0 deletions

View File

@ -58,6 +58,12 @@ static NSString * basePath = @"{{basePath}}";
{{#operation}}
/*!
* {{{summary}}}
* {{{notes}}}
{{#allParams}} * \param {{paramName}} {{{description}}}
{{/allParams}} * \returns {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/
-(NSNumber*) {{nickname}}WithCompletionBlock{{^allParams}}: {{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}
{{/allParams}}
{{#returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock{{/returnBaseType}}

View File

@ -56,6 +56,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Update an existing pet
*
* \param body Pet object that needs to be added to the store
* \returns void
*/
-(NSNumber*) updatePetWithCompletionBlock: (SWGPet*) body
@ -141,6 +147,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Add a new pet to the store
*
* \param body Pet object that needs to be added to the store
* \returns void
*/
-(NSNumber*) addPetWithCompletionBlock: (SWGPet*) body
@ -226,6 +238,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Finds Pets by status
* Multiple status values can be provided with comma seperated strings
* \param status Status values that need to be considered for filter
* \returns NSArray<SWGPet>*
*/
-(NSNumber*) findPetsByStatusWithCompletionBlock: (NSArray*) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock
@ -307,6 +325,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Finds Pets by tags
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
* \param tags Tags to filter by
* \returns NSArray<SWGPet>*
*/
-(NSNumber*) findPetsByTagsWithCompletionBlock: (NSArray*) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock
@ -388,6 +412,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* 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 SWGPet*
*/
-(NSNumber*) getPetByIdWithCompletionBlock: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock
@ -465,6 +495,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Updates a pet in the store with form data
*
* \param petId ID of pet that needs to be updated
* \param name Updated name of the pet
* \param status Updated status of the pet
* \returns void
*/
-(NSNumber*) updatePetWithFormWithCompletionBlock: (NSString*) petId
name: (NSString*) name
status: (NSString*) status
@ -546,6 +584,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Deletes a pet
*
* \param api_key
* \param petId Pet id to delete
* \returns void
*/
-(NSNumber*) deletePetWithCompletionBlock: (NSString*) api_key
petId: (NSNumber*) petId
@ -612,6 +657,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* uploads an image
*
* \param petId ID of pet to update
* \param additionalMetadata Additional data to pass to server
* \param file file to upload
* \returns void
*/
-(NSNumber*) uploadFileWithCompletionBlock: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata
file: (SWGFile*) file

View File

@ -55,6 +55,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Returns pet inventories by status
* Returns a map of status codes to quantities
* \returns NSDictionary*
*/
-(NSNumber*) getInventoryWithCompletionBlock:
(void (^)(NSDictionary* output, NSError* error))completionBlock
{
@ -122,6 +127,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Place an order for a pet
*
* \param body order placed for purchasing the pet
* \returns SWGOrder*
*/
-(NSNumber*) placeOrderWithCompletionBlock: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock
@ -221,6 +232,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Find purchase order by ID
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
* \param orderId ID of pet that needs to be fetched
* \returns SWGOrder*
*/
-(NSNumber*) getOrderByIdWithCompletionBlock: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock
@ -298,6 +315,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Delete purchase order by ID
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
* \param orderId ID of the order that needs to be deleted
* \returns void
*/
-(NSNumber*) deleteOrderWithCompletionBlock: (NSString*) orderId

View File

@ -55,6 +55,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Create user
* This can only be done by the logged in user.
* \param body Created user object
* \returns void
*/
-(NSNumber*) createUserWithCompletionBlock: (SWGUser*) body
@ -140,6 +146,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Creates list of users with given input array
*
* \param body List of user object
* \returns void
*/
-(NSNumber*) createUsersWithArrayInputWithCompletionBlock: (NSArray<SWGUser>*) body
@ -225,6 +237,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Creates list of users with given input array
*
* \param body List of user object
* \returns void
*/
-(NSNumber*) createUsersWithListInputWithCompletionBlock: (NSArray<SWGUser>*) body
@ -310,6 +328,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Logs user into the system
*
* \param username The user name for login
* \param password The password for login in clear text
* \returns NSString*
*/
-(NSNumber*) loginUserWithCompletionBlock: (NSString*) username
password: (NSString*) password
@ -393,6 +418,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Logs out current logged in user session
*
* \returns void
*/
-(NSNumber*) logoutUserWithCompletionBlock:
(void (^)(NSError* error))completionBlock {
@ -454,6 +484,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Get user by user name
*
* \param username The name that needs to be fetched. Use user1 for testing.
* \returns SWGUser*
*/
-(NSNumber*) getUserByNameWithCompletionBlock: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock
@ -531,6 +567,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Updated user
* This can only be done by the logged in user.
* \param username name that need to be deleted
* \param body Updated user object
* \returns void
*/
-(NSNumber*) updateUserWithCompletionBlock: (NSString*) username
body: (SWGUser*) body
@ -618,6 +661,12 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
}
/*!
* Delete user
* This can only be done by the logged in user.
* \param username The name that needs to be deleted
* \returns void
*/
-(NSNumber*) deleteUserWithCompletionBlock: (NSString*) username