import 'package:openapi/api.dart';
All URIs are relative to https://demo.2fauth.app
Method | HTTP request | Description |
---|---|---|
deleteSettingsName | DELETE /api/v1/settings/{name} | Delete custom setting |
getSettings | GET /api/v1/settings | Get all settings |
getSettingsName | GET /api/v1/settings/{name} | Find setting by name |
postSettings | POST /api/v1/settings | Create custom setting |
putSettingsName | PUT /api/v1/settings/{name} | Update setting |
deleteSettingsName(name)
Delete custom setting
Deletes a custom application setting. Settings endpoints are restricted to user with an Administrator
role.
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: Bearer-Auth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken(yourTokenGeneratorFunction);
final api_instance = SettingsApi();
final name = displayMode; // String | Name of the resource
try {
api_instance.deleteSettingsName(name);
} catch (e) {
print('Exception when calling SettingsApi->deleteSettingsName: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Name of the resource |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List getSettings()
Get all settings
List all application settings. This includes 2FAuth native settings and possible additional admin-defined settings. Settings endpoints are restricted to user with an Administrator
role.
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: Bearer-Auth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken(yourTokenGeneratorFunction);
final api_instance = SettingsApi();
try {
final result = api_instance.getSettings();
print(result);
} catch (e) {
print('Exception when calling SettingsApi->getSettings: $e\n');
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Setting getSettingsName(name)
Find setting by name
Returns a single application setting, whether it is a native 2FAuth setting or a custom setting. Settings endpoints are restricted to user with an Administrator
role.
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: Bearer-Auth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken(yourTokenGeneratorFunction);
final api_instance = SettingsApi();
final name = displayMode; // String | Name of the resource
try {
final result = api_instance.getSettingsName(name);
print(result);
} catch (e) {
print('Exception when calling SettingsApi->getSettingsName: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Name of the resource |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Setting postSettings(setting)
Create custom setting
Creates a new custom application setting. You are free to use this endpoint to store any data you need to administrate your own app. Settings endpoints are restricted to user with an Administrator
role.
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: Bearer-Auth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken(yourTokenGeneratorFunction);
final api_instance = SettingsApi();
final setting = Setting(); // Setting |
try {
final result = api_instance.postSettings(setting);
print(result);
} catch (e) {
print('Exception when calling SettingsApi->postSettings: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
setting | Setting | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Setting putSettingsName(name, putSettingsNameRequest)
Update setting
Updates an application setting, whether it is a native 2FAuth setting or a custom setting. Will create the setting if it does not exist. Settings endpoints are restricted to user with an Administrator
role.
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: Bearer-Auth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken(yourTokenGeneratorFunction);
final api_instance = SettingsApi();
final name = displayMode; // String | Name of the resource
final putSettingsNameRequest = PutSettingsNameRequest(); // PutSettingsNameRequest |
try {
final result = api_instance.putSettingsName(name, putSettingsNameRequest);
print(result);
} catch (e) {
print('Exception when calling SettingsApi->putSettingsName: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Name of the resource | |
putSettingsNameRequest | PutSettingsNameRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]