import 'package:openapi/api.dart';
All URIs are relative to https://demo.2fauth.app
Method | HTTP request | Description |
---|---|---|
getUserPreferences | GET /api/v1/user/preferences | Get all user preferences |
getUserPreferencesName | GET /api/v1/user/preferences/{name} | Find user preference by name |
putUserPreferencesName | PUT /api/v1/user/preferences/{name} | Update user preference |
List getUserPreferences()
Get all user preferences
List all preferences of the authenticated user.
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 = UserPreferenceApi();
try {
final result = api_instance.getUserPreferences();
print(result);
} catch (e) {
print('Exception when calling UserPreferenceApi->getUserPreferences: $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]
UserPreference getUserPreferencesName(name)
Find user preference by name
Returns a single preference of the authenticated user
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 = UserPreferenceApi();
final name = displayMode; // String | Name of the resource
try {
final result = api_instance.getUserPreferencesName(name);
print(result);
} catch (e) {
print('Exception when calling UserPreferenceApi->getUserPreferencesName: $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]
UserPreference putUserPreferencesName(name, putUserPreferencesNameRequest)
Update user preference
Updates a preference of the authenticated user.
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 = UserPreferenceApi();
final name = displayMode; // String | Name of the resource
final putUserPreferencesNameRequest = PutUserPreferencesNameRequest(); // PutUserPreferencesNameRequest |
try {
final result = api_instance.putUserPreferencesName(name, putUserPreferencesNameRequest);
print(result);
} catch (e) {
print('Exception when calling UserPreferenceApi->putUserPreferencesName: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Name of the resource | |
putUserPreferencesNameRequest | PutUserPreferencesNameRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]