William Cheng 0204bf4ae2 Squashed commit of the following:
commit c5a0d0f7394aa742fa336fff7e7c1d3049761868
Merge: 8c4991ba3ed f8ff8c87609
Author: William Cheng <wing328hk@gmail.com>
Date:   Tue Aug 17 18:28:12 2021 +0800

    Merge branch 'mustache-linting' of https://github.com/NathanBaulch/openapi-generator into NathanBaulch-mustache-linting

commit f8ff8c87609b1ca36fa26fb8474806999638195e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:12:47 2021 +1000

    Reorder tags that handle missing values

commit f5d8a33709d6a3f846a9fe4520b78c3d637051d9
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:08:59 2021 +1000

    Use dot notation where possible

commit 493d14921e2333f3ae19ef6fc89318b7e263a80c
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:10:49 2021 +1000

    Remove empty tags

commit 32480dc53f48227d55531b94e307d72671373737
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 10:41:58 2021 +1000

    Remove redundant sections

commit a8edabd722c34aa094b4aeb11c22664529c3a219
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 22:02:22 2021 +1000

    Trim extra EOF new lines

commit e89bd7458e3594bf0d30e580bc9408e45b018a57
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 21:59:26 2021 +1000

    Trim trailing whitespace
2021-08-17 18:37:51 +08:00

11 KiB

SWGUserApi

All URIs are relative to http://petstore.swagger.io/v2

Method HTTP request Description
createUser POST /user Create user
createUsersWithArrayInput POST /user/createWithArray Creates list of users with given input array
createUsersWithListInput POST /user/createWithList Creates list of users with given input array
deleteUser DELETE /user/{username} Delete user
getUserByName GET /user/{username} Get user by user name
loginUser GET /user/login Logs user into the system
logoutUser GET /user/logout Logs out current logged in user session
updateUser PUT /user/{username} Updated user

createUser

-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
        completionHandler: (void (^)(NSError* error)) handler;

Create user

This can only be done by the logged in user.

Example


SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional)

SWGUserApi*apiInstance = [[SWGUserApi alloc] init];

// Create user
[apiInstance createUserWithUser:user
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling SWGUserApi->createUser: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
user SWGUser* Created user object [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createUsersWithArrayInput

-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray<SWGUser>*) user
        completionHandler: (void (^)(NSError* error)) handler;

Creates list of users with given input array

Example


NSArray<SWGUser>* user = @[[[SWGUser alloc] init]]; // List of user object (optional)

SWGUserApi*apiInstance = [[SWGUserApi alloc] init];

// Creates list of users with given input array
[apiInstance createUsersWithArrayInputWithUser:user
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
user NSArray<SWGUser>* List of user object [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createUsersWithListInput

-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray<SWGUser>*) user
        completionHandler: (void (^)(NSError* error)) handler;

Creates list of users with given input array

Example


NSArray<SWGUser>* user = @[[[SWGUser alloc] init]]; // List of user object (optional)

SWGUserApi*apiInstance = [[SWGUserApi alloc] init];

// Creates list of users with given input array
[apiInstance createUsersWithListInputWithUser:user
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
user NSArray<SWGUser>* List of user object [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteUser

-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username
        completionHandler: (void (^)(NSError* error)) handler;

Delete user

This can only be done by the logged in user.

Example


NSString* username = @"username_example"; // The name that needs to be deleted

SWGUserApi*apiInstance = [[SWGUserApi alloc] init];

// Delete user
[apiInstance deleteUserWithUsername:username
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling SWGUserApi->deleteUser: %@", error);
                        }
                    }];

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: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUserByName

-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username
        completionHandler: (void (^)(SWGUser* output, NSError* error)) handler;

Get user by user name

Example


NSString* username = @"username_example"; // The name that needs to be fetched. Use user1 for testing. 

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 calling SWGUserApi->getUserByName: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
username NSString* The name that needs to be fetched. Use user1 for testing.

Return type

SWGUser*

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

loginUser

-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username
    password: (NSString*) password
        completionHandler: (void (^)(NSString* output, NSError* error)) handler;

Logs user into the system

Example


NSString* username = @"username_example"; // The user name for login (optional)
NSString* password = @"password_example"; // The password for login in clear text (optional)

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 calling SWGUserApi->loginUser: %@", error);
                        }
                    }];

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] [Back to Model list] [Back to README]

logoutUser

-(NSURLSessionTask*) logoutUserWithCompletionHandler: 
        (void (^)(NSError* error)) handler;

Logs out current logged in user session

Example



SWGUserApi*apiInstance = [[SWGUserApi alloc] init];

// Logs out current logged in user session
[apiInstance logoutUserWithCompletionHandler: 
          ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling SWGUserApi->logoutUser: %@", error);
                        }
                    }];

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: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateUser

-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
    user: (SWGUser*) user
        completionHandler: (void (^)(NSError* error)) handler;

Updated user

This can only be done by the logged in user.

Example


NSString* username = @"username_example"; // name that need to be deleted
SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional)

SWGUserApi*apiInstance = [[SWGUserApi alloc] init];

// Updated user
[apiInstance updateUserWithUsername:username
              user:user
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling SWGUserApi->updateUser: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
username NSString* name that need to be deleted
user SWGUser* Updated user object [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]