forked from loafle/openapi-generator-original
Merge pull request #2903 from wing328/master
[ObjC] remove try-catch block from objc sample code
This commit is contained in:
commit
19449c69b4
@ -42,8 +42,6 @@ Method | HTTP request | Description
|
||||
{{#allParams}}{{{dataType}}} {{paramName}} = {{{example}}}; // {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||
{{/allParams}}
|
||||
|
||||
@try
|
||||
{
|
||||
{{classname}}*apiInstance = [[{{classname}} alloc] init];
|
||||
|
||||
{{#summary}}// {{{.}}}
|
||||
@ -56,15 +54,9 @@ Method | HTTP request | Description
|
||||
}
|
||||
{{/returnType}}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling {{classname}}->{{operationId}}: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling {{classname}}->{{operationId}}: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -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-05-16T09:18:48.757+02:00
|
||||
- Build date: 2016-05-18T23:48:57.670+08:00
|
||||
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen
|
||||
|
||||
## Requirements
|
||||
@ -124,6 +124,12 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
## api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
## petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
@ -133,12 +139,6 @@ Class | Method | HTTP request | Description
|
||||
- **write:pets**: modify pets in your account
|
||||
- **read:pets**: read your pets
|
||||
|
||||
## api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
|
@ -376,7 +376,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
|
||||
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth", @"api_key"];
|
||||
NSArray *authSettings = @[@"api_key", @"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
|
@ -109,13 +109,6 @@
|
||||
|
||||
- (NSDictionary *) authSettings {
|
||||
return @{
|
||||
@"petstore_auth":
|
||||
@{
|
||||
@"type": @"oauth",
|
||||
@"in": @"header",
|
||||
@"key": @"Authorization",
|
||||
@"value": [self getAccessToken]
|
||||
},
|
||||
@"api_key":
|
||||
@{
|
||||
@"type": @"api_key",
|
||||
@ -123,6 +116,13 @@
|
||||
@"key": @"api_key",
|
||||
@"value": [self getApiKeyWithPrefix:@"api_key"]
|
||||
},
|
||||
@"petstore_auth":
|
||||
@{
|
||||
@"type": @"oauth",
|
||||
@"in": @"header",
|
||||
@"key": @"Authorization",
|
||||
@"value": [self getAccessToken]
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -34,23 +34,15 @@ SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||
|
||||
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);
|
||||
NSLog(@"Error calling SWGPetApi->addPet: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->addPet: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -96,8 +88,6 @@ SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||
NSNumber* petId = @789; // Pet id to delete
|
||||
NSString* apiKey = @"apiKey_example"; // (optional)
|
||||
|
||||
@try
|
||||
{
|
||||
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
// Deletes a pet
|
||||
@ -105,15 +95,9 @@ NSString* apiKey = @"apiKey_example"; // (optional)
|
||||
apiKey:apiKey
|
||||
completionHandler: ^(NSError* error) {
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGPetApi->deletePet: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->deletePet: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -158,8 +142,6 @@ SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||
|
||||
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
|
||||
@ -169,15 +151,9 @@ NSArray<NSString*>* status = @[@"available"]; // Status values that need to be c
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGPetApi->findPetsByStatus: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->findPetsByStatus: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -221,8 +197,6 @@ SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||
|
||||
NSArray<NSString*>* tags = @[@"tags_example"]; // Tags to filter by (optional)
|
||||
|
||||
@try
|
||||
{
|
||||
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
// Finds Pets by tags
|
||||
@ -232,15 +206,9 @@ NSArray<NSString*>* tags = @[@"tags_example"]; // Tags to filter by (optional)
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGPetApi->findPetsByTags: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->findPetsByTags: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -278,19 +246,17 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
```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"];
|
||||
|
||||
// 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
|
||||
|
||||
@try
|
||||
{
|
||||
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
// Find pet by ID
|
||||
@ -300,15 +266,9 @@ NSNumber* petId = @789; // ID of pet that needs to be fetched
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGPetApi->getPetById: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->getPetById: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -323,7 +283,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### 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
|
||||
|
||||
@ -352,23 +312,15 @@ SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||
|
||||
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);
|
||||
NSLog(@"Error calling SWGPetApi->updatePet: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->updatePet: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -416,8 +368,6 @@ 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
|
||||
@ -426,15 +376,9 @@ NSString* status = @"status_example"; // Updated status of the pet (optional)
|
||||
status:status
|
||||
completionHandler: ^(NSError* error) {
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGPetApi->updatePetWithForm: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->updatePetWithForm: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -484,8 +428,6 @@ 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
|
||||
@ -494,15 +436,9 @@ NSURL* file = [NSURL fileURLWithPath:@"/path/to/file.txt"]; // file to upload (o
|
||||
file:file
|
||||
completionHandler: ^(NSError* error) {
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGPetApi->uploadFile: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->uploadFile: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -25,23 +25,15 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
||||
|
||||
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);
|
||||
NSLog(@"Error calling SWGStoreApi->deleteOrder: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGStoreApi->deleteOrder: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -86,8 +78,6 @@ SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||
|
||||
|
||||
|
||||
@try
|
||||
{
|
||||
SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
|
||||
|
||||
// Returns pet inventories by status
|
||||
@ -97,15 +87,9 @@ SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGStoreApi->getInventory: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGStoreApi->getInventory: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -141,8 +125,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
|
||||
NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched
|
||||
|
||||
@try
|
||||
{
|
||||
SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
|
||||
|
||||
// Find purchase order by ID
|
||||
@ -152,15 +134,9 @@ NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGStoreApi->getOrderById: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGStoreApi->getOrderById: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -199,8 +175,6 @@ Place an order for a pet
|
||||
|
||||
SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional)
|
||||
|
||||
@try
|
||||
{
|
||||
SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
|
||||
|
||||
// Place an order for a pet
|
||||
@ -210,15 +184,9 @@ SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGStoreApi->placeOrder: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGStoreApi->placeOrder: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -29,23 +29,15 @@ This can only be done by the logged in user.
|
||||
|
||||
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);
|
||||
NSLog(@"Error calling SWGUserApi->createUser: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGUserApi->createUser: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -84,23 +76,15 @@ Creates list of users with given input array
|
||||
|
||||
NSArray<SWGUser>* 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);
|
||||
NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGUserApi->createUsersWithArrayInput: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -139,23 +123,15 @@ Creates list of users with given input array
|
||||
|
||||
NSArray<SWGUser>* 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);
|
||||
NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGUserApi->createUsersWithListInput: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -194,23 +170,15 @@ This can only be done by the logged in user.
|
||||
|
||||
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);
|
||||
NSLog(@"Error calling SWGUserApi->deleteUser: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGUserApi->deleteUser: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -249,8 +217,6 @@ Get user by user name
|
||||
|
||||
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
|
||||
@ -260,15 +226,9 @@ NSString* username = @"username_example"; // The name that needs to be fetched.
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGUserApi->getUserByName: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGUserApi->getUserByName: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -309,8 +269,6 @@ Logs user into the system
|
||||
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
|
||||
@ -321,15 +279,9 @@ NSString* password = @"password_example"; // The password for login in clear tex
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGUserApi->loginUser: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGUserApi->loginUser: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -368,23 +320,15 @@ Logs out current logged in user session
|
||||
```objc
|
||||
|
||||
|
||||
@try
|
||||
{
|
||||
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
|
||||
// Logs out current logged in user session
|
||||
[apiInstance logoutUserWithCompletionHandler:
|
||||
^(NSError* error) {
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGUserApi->logoutUser: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGUserApi->logoutUser: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -422,8 +366,6 @@ This can only be done by the logged in user.
|
||||
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
|
||||
@ -431,15 +373,9 @@ SWGUser* body = [[SWGUser alloc] init]; // Updated user object (optional)
|
||||
body:body
|
||||
completionHandler: ^(NSError* error) {
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
NSLog(@"Error calling SWGUserApi->updateUser: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGUserApi->updateUser: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
Loading…
x
Reference in New Issue
Block a user