[ObjC] minor code style enhancement to ObjC API client (#4437)

* minor code style enhancement to objc api client

* update petstore sample

* remove datatype from docstring (objc)
This commit is contained in:
wing328 2016-12-20 19:13:03 +08:00 committed by GitHub
parent c4ccf49064
commit 204c05442d
16 changed files with 166 additions and 288 deletions

View File

@ -75,11 +75,17 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513;
/// ///
/// {{{summary}}} /// {{{summary}}}
/// {{{notes}}} /// {{{notes}}}
/// {{#allParams}} @param {{paramName}} {{{description}}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{#allParams}}
/// @param {{paramName}} {{{description}}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
/// ///
/// {{/allParams}} @returns {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{/allParams}}
/// {{#responses}}
-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} /// code:{{{code}}} message:"{{{message}}}"{{#hasMore}},{{/hasMore}}
{{/responses}}
{{#returnType}}
/// @return {{{returnType}}}
{{/returnType}}
-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{operationId}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}}
{{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}}
{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler { {{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler {
{{#allParams}} {{#allParams}}
@ -181,6 +187,5 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513;
{{/operation}} {{/operation}}
{{newline}}
{{/operations}} {{/operations}}
@end @end

View File

@ -16,18 +16,23 @@ extern NSInteger k{{classname}}MissingParamErrorCode;
{{#operations}} {{#operations}}
{{#operation}} {{#operation}}
/// {{{summary}}} /// {{{summary}}}
/// {{#notes}}{{{notes}}}{{/notes}} {{#notes}}
/// {{{notes}}}
{{/notes}}
/// ///
/// {{#allParams}}@param {{paramName}} {{description}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} {{#allParams}}
/// {{/allParams}}{{#responses}} /// @param {{paramName}} {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
/// code:{{{code}}} message:"{{{message}}}"{{#hasMore}},{{/hasMore}}{{/responses}} {{/allParams}}
///{{#returnType}} {{#responses}}
/// @return {{{returnType}}}{{/returnType}} /// code:{{{code}}} message:"{{{message}}}"{{#hasMore}},{{/hasMore}}
-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} {{/responses}}
{{#returnType}}
/// @return {{{returnType}}}
{{/returnType}}
-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{operationId}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}}
{{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}}
{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler; {{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler;
{{newline}}
{{/operation}} {{/operation}}
{{/operations}} {{/operations}}

View File

@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen - Build package: io.swagger.codegen.languages.ObjcClientCodegen
## Requirements ## Requirements

View File

@ -27,113 +27,84 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
/// ///
/// ///
/// @param body Pet object that needs to be added to the store (optional) /// @param body Pet object that needs to be added to the store (optional)
///
/// code:405 message:"Invalid input" /// code:405 message:"Invalid input"
///
/// @return
-(NSNumber*) addPetWithBody: (SWGPet*) body -(NSNumber*) addPetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Deletes a pet /// Deletes a pet
/// ///
/// ///
/// @param petId Pet id to delete /// @param petId Pet id to delete
/// @param apiKey (optional) /// @param apiKey (optional)
///
/// code:400 message:"Invalid pet value" /// code:400 message:"Invalid pet value"
///
/// @return
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId -(NSNumber*) deletePetWithPetId: (NSNumber*) petId
apiKey: (NSString*) apiKey apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Finds Pets by status /// Finds Pets by status
/// Multiple status values can be provided with comma separated strings /// Multiple status values can be provided with comma separated strings
/// ///
/// @param status Status values that need to be considered for filter (optional) (default to available) /// @param status Status values that need to be considered for filter (optional) (default to available)
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid status value" /// code:400 message:"Invalid status value"
///
/// @return NSArray<SWGPet>* /// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status -(NSNumber*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler; completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler;
/// Finds Pets by tags /// Finds Pets by tags
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
/// ///
/// @param tags Tags to filter by (optional) /// @param tags Tags to filter by (optional)
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid tag value" /// code:400 message:"Invalid tag value"
///
/// @return NSArray<SWGPet>* /// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags -(NSNumber*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler; completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler;
/// Find pet by ID /// Find pet by ID
/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions /// 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 /// @param petId ID of pet that needs to be fetched
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid ID supplied", /// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found" /// code:404 message:"Pet not found"
///
/// @return SWGPet* /// @return SWGPet*
-(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; completionHandler: (void (^)(SWGPet* output, NSError* error)) handler;
/// Update an existing pet /// Update an existing pet
/// ///
/// ///
/// @param body Pet object that needs to be added to the store (optional) /// @param body Pet object that needs to be added to the store (optional)
///
/// code:400 message:"Invalid ID supplied", /// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found", /// code:404 message:"Pet not found",
/// code:405 message:"Validation exception" /// code:405 message:"Validation exception"
///
/// @return
-(NSNumber*) updatePetWithBody: (SWGPet*) body -(NSNumber*) updatePetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Updates a pet in the store with form data /// Updates a pet in the store with form data
/// ///
/// ///
/// @param petId ID of pet that needs to be updated /// @param petId ID of pet that needs to be updated
/// @param name Updated name of the pet (optional) /// @param name Updated name of the pet (optional)
/// @param status Updated status of the pet (optional) /// @param status Updated status of the pet (optional)
///
/// code:405 message:"Invalid input" /// code:405 message:"Invalid input"
///
/// @return
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId -(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
name: (NSString*) name name: (NSString*) name
status: (NSString*) status status: (NSString*) status
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// uploads an image /// uploads an image
/// ///
/// ///
/// @param petId ID of pet to update /// @param petId ID of pet to update
/// @param additionalMetadata Additional data to pass to server (optional) /// @param additionalMetadata Additional data to pass to server (optional)
/// @param file file to upload (optional) /// @param file file to upload (optional)
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId -(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata additionalMetadata: (NSString*) additionalMetadata
file: (NSURL*) file file: (NSURL*) file
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
@end @end

View File

@ -72,10 +72,9 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Add a new pet to the store /// Add a new pet to the store
/// ///
/// @param body Pet object that needs to be added to the store (optional) /// @param body Pet object that needs to be added to the store (optional)
///
/// @returns void
/// ///
/// code:405 message:"Invalid input"
-(NSNumber*) addPetWithBody: (SWGPet*) body -(NSNumber*) addPetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
@ -131,12 +130,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Deletes a pet /// Deletes a pet
/// ///
/// @param petId Pet id to delete /// @param petId Pet id to delete
/// ///
/// @param apiKey (optional) /// @param apiKey (optional)
///
/// @returns void
/// ///
/// code:400 message:"Invalid pet value"
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId -(NSNumber*) deletePetWithPetId: (NSNumber*) petId
apiKey: (NSString*) apiKey apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
@ -209,10 +207,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Finds Pets by status /// Finds Pets by status
/// Multiple status values can be provided with comma separated strings /// Multiple status values can be provided with comma separated strings
/// @param status Status values that need to be considered for filter (optional, default to available) /// @param status Status values that need to be considered for filter (optional, default to available)
///
/// @returns NSArray<SWGPet>*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid status value"
/// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status -(NSNumber*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler { completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"];
@ -271,10 +270,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Finds Pets by tags /// Finds Pets by tags
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
/// @param tags Tags to filter by (optional) /// @param tags Tags to filter by (optional)
///
/// @returns NSArray<SWGPet>*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid tag value"
/// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags -(NSNumber*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler { completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"];
@ -333,10 +333,12 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Find pet by ID /// Find pet by ID
/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions /// 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 /// @param petId ID of pet that needs to be fetched
///
/// @returns SWGPet*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found"
/// @return SWGPet*
-(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { completionHandler: (void (^)(SWGPet* output, NSError* error)) handler {
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
@ -405,10 +407,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Update an existing pet /// Update an existing pet
/// ///
/// @param body Pet object that needs to be added to the store (optional) /// @param body Pet object that needs to be added to the store (optional)
///
/// @returns void
/// ///
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found",
/// code:405 message:"Validation exception"
-(NSNumber*) updatePetWithBody: (SWGPet*) body -(NSNumber*) updatePetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
@ -464,14 +467,13 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Updates a pet in the store with form data /// Updates a pet in the store with form data
/// ///
/// @param petId ID of pet that needs to be updated /// @param petId ID of pet that needs to be updated
/// ///
/// @param name Updated name of the pet (optional) /// @param name Updated name of the pet (optional)
/// ///
/// @param status Updated status of the pet (optional) /// @param status Updated status of the pet (optional)
///
/// @returns void
/// ///
/// code:405 message:"Invalid input"
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId -(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
name: (NSString*) name name: (NSString*) name
status: (NSString*) status status: (NSString*) status
@ -548,14 +550,13 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// uploads an image /// uploads an image
/// ///
/// @param petId ID of pet to update /// @param petId ID of pet to update
/// ///
/// @param additionalMetadata Additional data to pass to server (optional) /// @param additionalMetadata Additional data to pass to server (optional)
/// ///
/// @param file file to upload (optional) /// @param file file to upload (optional)
///
/// @returns void
/// ///
/// code:0 message:"successful operation"
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId -(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata additionalMetadata: (NSString*) additionalMetadata
file: (NSURL*) file file: (NSURL*) file
@ -628,5 +629,4 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
} }
@end @end

View File

@ -27,52 +27,39 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode;
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// 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 /// @param orderId ID of the order that needs to be deleted
///
/// code:400 message:"Invalid ID supplied", /// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found" /// code:404 message:"Order not found"
///
/// @return
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId -(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Returns pet inventories by status /// Returns pet inventories by status
/// Returns a map of status codes to quantities /// Returns a map of status codes to quantities
/// ///
///
/// code:200 message:"successful operation" /// code:200 message:"successful operation"
///
/// @return NSDictionary<NSString*, NSNumber*>* /// @return NSDictionary<NSString*, NSNumber*>*
-(NSNumber*) getInventoryWithCompletionHandler: -(NSNumber*) getInventoryWithCompletionHandler:
(void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler; (void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler;
/// Find purchase order by ID /// Find purchase order by ID
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// 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 /// @param orderId ID of pet that needs to be fetched
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid ID supplied", /// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found" /// code:404 message:"Order not found"
///
/// @return SWGOrder* /// @return SWGOrder*
-(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId -(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
/// Place an order for a pet /// Place an order for a pet
/// ///
/// ///
/// @param body order placed for purchasing the pet (optional) /// @param body order placed for purchasing the pet (optional)
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid Order" /// code:400 message:"Invalid Order"
///
/// @return SWGOrder* /// @return SWGOrder*
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body -(NSNumber*) placeOrderWithBody: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
@end @end

View File

@ -72,10 +72,10 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
/// ///
/// Delete purchase order by ID /// Delete purchase order by ID
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// 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 /// @param orderId ID of the order that needs to be deleted
///
/// @returns void
/// ///
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found"
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId -(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
@ -144,8 +144,8 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
/// ///
/// Returns pet inventories by status /// Returns pet inventories by status
/// Returns a map of status codes to quantities /// Returns a map of status codes to quantities
/// @returns NSDictionary<NSString*, NSNumber*>* /// code:200 message:"successful operation"
/// /// @return NSDictionary<NSString*, NSNumber*>*
-(NSNumber*) getInventoryWithCompletionHandler: -(NSNumber*) getInventoryWithCompletionHandler:
(void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler { (void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"];
@ -200,10 +200,12 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
/// ///
/// Find purchase order by ID /// Find purchase order by ID
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// 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 /// @param orderId ID of pet that needs to be fetched
///
/// @returns SWGOrder*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found"
/// @return SWGOrder*
-(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId -(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
@ -272,10 +274,11 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
/// ///
/// Place an order for a pet /// Place an order for a pet
/// ///
/// @param body order placed for purchasing the pet (optional) /// @param body order placed for purchasing the pet (optional)
///
/// @returns SWGOrder*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid Order"
/// @return SWGOrder*
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body -(NSNumber*) placeOrderWithBody: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"];
@ -329,5 +332,4 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
} }
@end @end

View File

@ -27,105 +27,75 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// ///
/// @param body Created user object (optional) /// @param body Created user object (optional)
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) createUserWithBody: (SWGUser*) body -(NSNumber*) createUserWithBody: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// ///
/// @param body List of user object (optional) /// @param body List of user object (optional)
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// ///
/// @param body List of user object (optional) /// @param body List of user object (optional)
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Delete user /// Delete user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// ///
/// @param username The name that needs to be deleted /// @param username The name that needs to be deleted
///
/// code:400 message:"Invalid username supplied", /// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found" /// code:404 message:"User not found"
///
/// @return
-(NSNumber*) deleteUserWithUsername: (NSString*) username -(NSNumber*) deleteUserWithUsername: (NSString*) username
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Get user by user name /// Get user by user name
/// ///
/// ///
/// @param username The name that needs to be fetched. Use user1 for testing. /// @param username The name that needs to be fetched. Use user1 for testing.
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid username supplied", /// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found" /// code:404 message:"User not found"
///
/// @return SWGUser* /// @return SWGUser*
-(NSNumber*) getUserByNameWithUsername: (NSString*) username -(NSNumber*) getUserByNameWithUsername: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; completionHandler: (void (^)(SWGUser* output, NSError* error)) handler;
/// Logs user into the system /// Logs user into the system
/// ///
/// ///
/// @param username The user name for login (optional) /// @param username The user name for login (optional)
/// @param password The password for login in clear text (optional) /// @param password The password for login in clear text (optional)
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid username/password supplied" /// code:400 message:"Invalid username/password supplied"
///
/// @return NSString* /// @return NSString*
-(NSNumber*) loginUserWithUsername: (NSString*) username -(NSNumber*) loginUserWithUsername: (NSString*) username
password: (NSString*) password password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error)) handler; completionHandler: (void (^)(NSString* output, NSError* error)) handler;
/// Logs out current logged in user session /// Logs out current logged in user session
/// ///
/// ///
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) logoutUserWithCompletionHandler: -(NSNumber*) logoutUserWithCompletionHandler:
(void (^)(NSError* error)) handler; (void (^)(NSError* error)) handler;
/// Updated user /// Updated user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// ///
/// @param username name that need to be deleted /// @param username name that need to be deleted
/// @param body Updated user object (optional) /// @param body Updated user object (optional)
///
/// code:400 message:"Invalid user supplied", /// code:400 message:"Invalid user supplied",
/// code:404 message:"User not found" /// code:404 message:"User not found"
///
/// @return
-(NSNumber*) updateUserWithUsername: (NSString*) username -(NSNumber*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body body: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
@end @end

View File

@ -72,10 +72,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Create user /// Create user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// @param body Created user object (optional) /// @param body Created user object (optional)
///
/// @returns void
/// ///
/// code:0 message:"successful operation"
-(NSNumber*) createUserWithBody: (SWGUser*) body -(NSNumber*) createUserWithBody: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"];
@ -131,10 +130,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// @param body List of user object (optional) /// @param body List of user object (optional)
///
/// @returns void
/// ///
/// code:0 message:"successful operation"
-(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"];
@ -190,10 +188,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// @param body List of user object (optional) /// @param body List of user object (optional)
///
/// @returns void
/// ///
/// code:0 message:"successful operation"
-(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"];
@ -249,10 +246,10 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Delete user /// Delete user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// @param username The name that needs to be deleted /// @param username The name that needs to be deleted
///
/// @returns void
/// ///
/// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found"
-(NSNumber*) deleteUserWithUsername: (NSString*) username -(NSNumber*) deleteUserWithUsername: (NSString*) username
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
@ -321,10 +318,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Get user by user name /// Get user by user name
/// ///
/// @param username The name that needs to be fetched. Use user1 for testing. /// @param username The name that needs to be fetched. Use user1 for testing.
///
/// @returns SWGUser*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found"
/// @return SWGUser*
-(NSNumber*) getUserByNameWithUsername: (NSString*) username -(NSNumber*) getUserByNameWithUsername: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { completionHandler: (void (^)(SWGUser* output, NSError* error)) handler {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
@ -393,12 +392,13 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Logs user into the system /// Logs user into the system
/// ///
/// @param username The user name for login (optional) /// @param username The user name for login (optional)
/// ///
/// @param password The password for login in clear text (optional) /// @param password The password for login in clear text (optional)
///
/// @returns NSString*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid username/password supplied"
/// @return NSString*
-(NSNumber*) loginUserWithUsername: (NSString*) username -(NSNumber*) loginUserWithUsername: (NSString*) username
password: (NSString*) password password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error)) handler { completionHandler: (void (^)(NSString* output, NSError* error)) handler {
@ -460,8 +460,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Logs out current logged in user session /// Logs out current logged in user session
/// ///
/// @returns void /// code:0 message:"successful operation"
///
-(NSNumber*) logoutUserWithCompletionHandler: -(NSNumber*) logoutUserWithCompletionHandler:
(void (^)(NSError* error)) handler { (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"];
@ -516,12 +515,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Updated user /// Updated user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// @param username name that need to be deleted /// @param username name that need to be deleted
/// ///
/// @param body Updated user object (optional) /// @param body Updated user object (optional)
///
/// @returns void
/// ///
/// code:400 message:"Invalid user supplied",
/// code:404 message:"User not found"
-(NSNumber*) updateUserWithUsername: (NSString*) username -(NSNumber*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body body: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
@ -590,5 +589,4 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
} }
@end @end

View File

@ -27,108 +27,84 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
/// ///
/// ///
/// @param body Pet object that needs to be added to the store (optional) /// @param body Pet object that needs to be added to the store (optional)
///
/// code:405 message:"Invalid input" /// code:405 message:"Invalid input"
///
-(NSNumber*) addPetWithBody: (SWGPet*) body -(NSNumber*) addPetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Deletes a pet /// Deletes a pet
/// ///
/// ///
/// @param petId Pet id to delete /// @param petId Pet id to delete
/// @param apiKey (optional) /// @param apiKey (optional)
///
/// code:400 message:"Invalid pet value" /// code:400 message:"Invalid pet value"
///
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId -(NSNumber*) deletePetWithPetId: (NSNumber*) petId
apiKey: (NSString*) apiKey apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Finds Pets by status /// Finds Pets by status
/// Multiple status values can be provided with comma separated strings /// Multiple status values can be provided with comma separated strings
/// ///
/// @param status Status values that need to be considered for filter (optional) (default to available) /// @param status Status values that need to be considered for filter (optional) (default to available)
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid status value" /// code:400 message:"Invalid status value"
///
/// @return NSArray<SWGPet>* /// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status -(NSNumber*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler; completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler;
/// Finds Pets by tags /// Finds Pets by tags
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
/// ///
/// @param tags Tags to filter by (optional) /// @param tags Tags to filter by (optional)
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid tag value" /// code:400 message:"Invalid tag value"
///
/// @return NSArray<SWGPet>* /// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags -(NSNumber*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler; completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler;
/// Find pet by ID /// Find pet by ID
/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions /// 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 /// @param petId ID of pet that needs to be fetched
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid ID supplied", /// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found" /// code:404 message:"Pet not found"
///
/// @return SWGPet* /// @return SWGPet*
-(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; completionHandler: (void (^)(SWGPet* output, NSError* error)) handler;
/// Update an existing pet /// Update an existing pet
/// ///
/// ///
/// @param body Pet object that needs to be added to the store (optional) /// @param body Pet object that needs to be added to the store (optional)
///
/// code:400 message:"Invalid ID supplied", /// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found", /// code:404 message:"Pet not found",
/// code:405 message:"Validation exception" /// code:405 message:"Validation exception"
///
-(NSNumber*) updatePetWithBody: (SWGPet*) body -(NSNumber*) updatePetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Updates a pet in the store with form data /// Updates a pet in the store with form data
/// ///
/// ///
/// @param petId ID of pet that needs to be updated /// @param petId ID of pet that needs to be updated
/// @param name Updated name of the pet (optional) /// @param name Updated name of the pet (optional)
/// @param status Updated status of the pet (optional) /// @param status Updated status of the pet (optional)
///
/// code:405 message:"Invalid input" /// code:405 message:"Invalid input"
///
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId -(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
name: (NSString*) name name: (NSString*) name
status: (NSString*) status status: (NSString*) status
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// uploads an image /// uploads an image
/// ///
/// ///
/// @param petId ID of pet to update /// @param petId ID of pet to update
/// @param additionalMetadata Additional data to pass to server (optional) /// @param additionalMetadata Additional data to pass to server (optional)
/// @param file file to upload (optional) /// @param file file to upload (optional)
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId -(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata additionalMetadata: (NSString*) additionalMetadata
file: (NSURL*) file file: (NSURL*) file
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
@end @end

View File

@ -72,10 +72,9 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Add a new pet to the store /// Add a new pet to the store
/// ///
/// @param body Pet object that needs to be added to the store (optional) /// @param body Pet object that needs to be added to the store (optional)
///
/// @returns void
/// ///
/// code:405 message:"Invalid input"
-(NSNumber*) addPetWithBody: (SWGPet*) body -(NSNumber*) addPetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
@ -131,12 +130,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Deletes a pet /// Deletes a pet
/// ///
/// @param petId Pet id to delete /// @param petId Pet id to delete
/// ///
/// @param apiKey (optional) /// @param apiKey (optional)
///
/// @returns void
/// ///
/// code:400 message:"Invalid pet value"
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId -(NSNumber*) deletePetWithPetId: (NSNumber*) petId
apiKey: (NSString*) apiKey apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
@ -209,10 +207,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Finds Pets by status /// Finds Pets by status
/// Multiple status values can be provided with comma separated strings /// Multiple status values can be provided with comma separated strings
/// @param status Status values that need to be considered for filter (optional, default to available) /// @param status Status values that need to be considered for filter (optional, default to available)
///
/// @returns NSArray<SWGPet>*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid status value"
/// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status -(NSNumber*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler { completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"];
@ -271,10 +270,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Finds Pets by tags /// Finds Pets by tags
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
/// @param tags Tags to filter by (optional) /// @param tags Tags to filter by (optional)
///
/// @returns NSArray<SWGPet>*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid tag value"
/// @return NSArray<SWGPet>*
-(NSNumber*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags -(NSNumber*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler { completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"];
@ -333,10 +333,12 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Find pet by ID /// Find pet by ID
/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions /// 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 /// @param petId ID of pet that needs to be fetched
///
/// @returns SWGPet*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found"
/// @return SWGPet*
-(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { completionHandler: (void (^)(SWGPet* output, NSError* error)) handler {
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
@ -376,7 +378,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
// Authentication setting // Authentication setting
NSArray *authSettings = @[@"petstore_auth", @"api_key"]; NSArray *authSettings = @[@"api_key", @"petstore_auth"];
id bodyParam = nil; id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
@ -405,10 +407,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Update an existing pet /// Update an existing pet
/// ///
/// @param body Pet object that needs to be added to the store (optional) /// @param body Pet object that needs to be added to the store (optional)
///
/// @returns void
/// ///
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Pet not found",
/// code:405 message:"Validation exception"
-(NSNumber*) updatePetWithBody: (SWGPet*) body -(NSNumber*) updatePetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
@ -464,14 +467,13 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// Updates a pet in the store with form data /// Updates a pet in the store with form data
/// ///
/// @param petId ID of pet that needs to be updated /// @param petId ID of pet that needs to be updated
/// ///
/// @param name Updated name of the pet (optional) /// @param name Updated name of the pet (optional)
/// ///
/// @param status Updated status of the pet (optional) /// @param status Updated status of the pet (optional)
///
/// @returns void
/// ///
/// code:405 message:"Invalid input"
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId -(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
name: (NSString*) name name: (NSString*) name
status: (NSString*) status status: (NSString*) status
@ -548,14 +550,13 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
/// ///
/// uploads an image /// uploads an image
/// ///
/// @param petId ID of pet to update /// @param petId ID of pet to update
/// ///
/// @param additionalMetadata Additional data to pass to server (optional) /// @param additionalMetadata Additional data to pass to server (optional)
/// ///
/// @param file file to upload (optional) /// @param file file to upload (optional)
///
/// @returns void
/// ///
/// code:0 message:"successful operation"
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId -(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata additionalMetadata: (NSString*) additionalMetadata
file: (NSURL*) file file: (NSURL*) file
@ -628,5 +629,4 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
} }
@end @end

View File

@ -27,51 +27,39 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode;
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// 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 /// @param orderId ID of the order that needs to be deleted
///
/// code:400 message:"Invalid ID supplied", /// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found" /// code:404 message:"Order not found"
///
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId -(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Returns pet inventories by status /// Returns pet inventories by status
/// Returns a map of status codes to quantities /// Returns a map of status codes to quantities
/// ///
///
/// code:200 message:"successful operation" /// code:200 message:"successful operation"
///
/// @return NSDictionary<NSString*, NSNumber*>* /// @return NSDictionary<NSString*, NSNumber*>*
-(NSNumber*) getInventoryWithCompletionHandler: -(NSNumber*) getInventoryWithCompletionHandler:
(void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler; (void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler;
/// Find purchase order by ID /// Find purchase order by ID
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// 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 /// @param orderId ID of pet that needs to be fetched
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid ID supplied", /// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found" /// code:404 message:"Order not found"
///
/// @return SWGOrder* /// @return SWGOrder*
-(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId -(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
/// Place an order for a pet /// Place an order for a pet
/// ///
/// ///
/// @param body order placed for purchasing the pet (optional) /// @param body order placed for purchasing the pet (optional)
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid Order" /// code:400 message:"Invalid Order"
///
/// @return SWGOrder* /// @return SWGOrder*
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body -(NSNumber*) placeOrderWithBody: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
@end @end

View File

@ -72,10 +72,10 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
/// ///
/// Delete purchase order by ID /// Delete purchase order by ID
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// 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 /// @param orderId ID of the order that needs to be deleted
///
/// @returns void
/// ///
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found"
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId -(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
@ -144,8 +144,8 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
/// ///
/// Returns pet inventories by status /// Returns pet inventories by status
/// Returns a map of status codes to quantities /// Returns a map of status codes to quantities
/// @returns NSDictionary<NSString*, NSNumber*>* /// code:200 message:"successful operation"
/// /// @return NSDictionary<NSString*, NSNumber*>*
-(NSNumber*) getInventoryWithCompletionHandler: -(NSNumber*) getInventoryWithCompletionHandler:
(void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler { (void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"];
@ -200,10 +200,12 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
/// ///
/// Find purchase order by ID /// Find purchase order by ID
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// 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 /// @param orderId ID of pet that needs to be fetched
///
/// @returns SWGOrder*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found"
/// @return SWGOrder*
-(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId -(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
@ -272,10 +274,11 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
/// ///
/// Place an order for a pet /// Place an order for a pet
/// ///
/// @param body order placed for purchasing the pet (optional) /// @param body order placed for purchasing the pet (optional)
///
/// @returns SWGOrder*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid Order"
/// @return SWGOrder*
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body -(NSNumber*) placeOrderWithBody: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"];
@ -329,5 +332,4 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
} }
@end @end

View File

@ -27,99 +27,75 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// ///
/// @param body Created user object (optional) /// @param body Created user object (optional)
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
-(NSNumber*) createUserWithBody: (SWGUser*) body -(NSNumber*) createUserWithBody: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// ///
/// @param body List of user object (optional) /// @param body List of user object (optional)
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
-(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// ///
/// @param body List of user object (optional) /// @param body List of user object (optional)
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
-(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Delete user /// Delete user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// ///
/// @param username The name that needs to be deleted /// @param username The name that needs to be deleted
///
/// code:400 message:"Invalid username supplied", /// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found" /// code:404 message:"User not found"
///
-(NSNumber*) deleteUserWithUsername: (NSString*) username -(NSNumber*) deleteUserWithUsername: (NSString*) username
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
/// Get user by user name /// Get user by user name
/// ///
/// ///
/// @param username The name that needs to be fetched. Use user1 for testing. /// @param username The name that needs to be fetched. Use user1 for testing.
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid username supplied", /// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found" /// code:404 message:"User not found"
///
/// @return SWGUser* /// @return SWGUser*
-(NSNumber*) getUserByNameWithUsername: (NSString*) username -(NSNumber*) getUserByNameWithUsername: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; completionHandler: (void (^)(SWGUser* output, NSError* error)) handler;
/// Logs user into the system /// Logs user into the system
/// ///
/// ///
/// @param username The user name for login (optional) /// @param username The user name for login (optional)
/// @param password The password for login in clear text (optional) /// @param password The password for login in clear text (optional)
///
/// code:200 message:"successful operation", /// code:200 message:"successful operation",
/// code:400 message:"Invalid username/password supplied" /// code:400 message:"Invalid username/password supplied"
///
/// @return NSString* /// @return NSString*
-(NSNumber*) loginUserWithUsername: (NSString*) username -(NSNumber*) loginUserWithUsername: (NSString*) username
password: (NSString*) password password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error)) handler; completionHandler: (void (^)(NSString* output, NSError* error)) handler;
/// Logs out current logged in user session /// Logs out current logged in user session
/// ///
/// ///
///
/// code:0 message:"successful operation" /// code:0 message:"successful operation"
///
-(NSNumber*) logoutUserWithCompletionHandler: -(NSNumber*) logoutUserWithCompletionHandler:
(void (^)(NSError* error)) handler; (void (^)(NSError* error)) handler;
/// Updated user /// Updated user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// ///
/// @param username name that need to be deleted /// @param username name that need to be deleted
/// @param body Updated user object (optional) /// @param body Updated user object (optional)
///
/// code:400 message:"Invalid user supplied", /// code:400 message:"Invalid user supplied",
/// code:404 message:"User not found" /// code:404 message:"User not found"
///
-(NSNumber*) updateUserWithUsername: (NSString*) username -(NSNumber*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body body: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler; completionHandler: (void (^)(NSError* error)) handler;
@end @end

View File

@ -72,10 +72,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Create user /// Create user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// @param body Created user object (optional) /// @param body Created user object (optional)
///
/// @returns void
/// ///
/// code:0 message:"successful operation"
-(NSNumber*) createUserWithBody: (SWGUser*) body -(NSNumber*) createUserWithBody: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"];
@ -131,10 +130,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// @param body List of user object (optional) /// @param body List of user object (optional)
///
/// @returns void
/// ///
/// code:0 message:"successful operation"
-(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"];
@ -190,10 +188,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// @param body List of user object (optional) /// @param body List of user object (optional)
///
/// @returns void
/// ///
/// code:0 message:"successful operation"
-(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body -(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"];
@ -249,10 +246,10 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Delete user /// Delete user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// @param username The name that needs to be deleted /// @param username The name that needs to be deleted
///
/// @returns void
/// ///
/// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found"
-(NSNumber*) deleteUserWithUsername: (NSString*) username -(NSNumber*) deleteUserWithUsername: (NSString*) username
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
@ -321,10 +318,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Get user by user name /// Get user by user name
/// ///
/// @param username The name that needs to be fetched. Use user1 for testing. /// @param username The name that needs to be fetched. Use user1 for testing.
///
/// @returns SWGUser*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found"
/// @return SWGUser*
-(NSNumber*) getUserByNameWithUsername: (NSString*) username -(NSNumber*) getUserByNameWithUsername: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { completionHandler: (void (^)(SWGUser* output, NSError* error)) handler {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
@ -393,12 +392,13 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Logs user into the system /// Logs user into the system
/// ///
/// @param username The user name for login (optional) /// @param username The user name for login (optional)
/// ///
/// @param password The password for login in clear text (optional) /// @param password The password for login in clear text (optional)
///
/// @returns NSString*
/// ///
/// code:200 message:"successful operation",
/// code:400 message:"Invalid username/password supplied"
/// @return NSString*
-(NSNumber*) loginUserWithUsername: (NSString*) username -(NSNumber*) loginUserWithUsername: (NSString*) username
password: (NSString*) password password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error)) handler { completionHandler: (void (^)(NSString* output, NSError* error)) handler {
@ -460,8 +460,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Logs out current logged in user session /// Logs out current logged in user session
/// ///
/// @returns void /// code:0 message:"successful operation"
///
-(NSNumber*) logoutUserWithCompletionHandler: -(NSNumber*) logoutUserWithCompletionHandler:
(void (^)(NSError* error)) handler { (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"];
@ -516,12 +515,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
/// ///
/// Updated user /// Updated user
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// @param username name that need to be deleted /// @param username name that need to be deleted
/// ///
/// @param body Updated user object (optional) /// @param body Updated user object (optional)
///
/// @returns void
/// ///
/// code:400 message:"Invalid user supplied",
/// code:404 message:"User not found"
-(NSNumber*) updateUserWithUsername: (NSString*) username -(NSNumber*) updateUserWithUsername: (NSString*) username
body: (SWGUser*) body body: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler { completionHandler: (void (^)(NSError* error)) handler {
@ -590,5 +589,4 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
} }
@end @end

View File

@ -246,14 +246,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
```objc ```objc
SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; 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) // Configure API key authorization: (authentication scheme: api_key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
NSNumber* petId = @789; // ID of pet that needs to be fetched NSNumber* petId = @789; // ID of pet that needs to be fetched
@ -283,7 +283,7 @@ Name | Type | Description | Notes
### Authorization ### Authorization
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) [api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers ### HTTP request headers
@ -447,7 +447,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**petId** | **NSNumber***| ID of pet to update | **petId** | **NSNumber***| ID of pet to update |
**additionalMetadata** | **NSString***| Additional data to pass to server | [optional] **additionalMetadata** | **NSString***| Additional data to pass to server | [optional]
**file** | **NSURL*****NSURL***| file to upload | [optional] **file** | **NSURL***| file to upload | [optional]
### Return type ### Return type