import 'package:openapi/api.dart';
All URIs are relative to https://demo.2fauth.app
Method | HTTP request | Description |
---|---|---|
deleteGroupsId | DELETE /api/v1/groups/{id} | Delete group |
getGroups | GET /api/v1/groups | Get all groups |
getGroupsId | GET /api/v1/groups/{id} | Find group by ID |
getGroupsIdTwofaccounts | GET /api/v1/groups/{id}/twofaccounts | Get all 2FA accounts of a group |
postGroups | POST /api/v1/groups | Create Group |
postGroupsIdAssign | POST /api/v1/groups/{id}/assign | Add 2FA accounts to a group |
putGroupsId | PUT /api/v1/groups/{id} | Update group |
deleteGroupsId(id)
Delete group
Deletes a group of the authenticated user. This will not delete any assigned 2FA accounts.
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 = GroupsApi();
final id = 1; // int | The ID of the resource
try {
api_instance.deleteGroupsId(id);
} catch (e) {
print('Exception when calling GroupsApi->deleteGroupsId: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | The ID 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 getGroups()
Get all groups
Find all groups 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 = GroupsApi();
try {
final result = api_instance.getGroups();
print(result);
} catch (e) {
print('Exception when calling GroupsApi->getGroups: $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]
GroupRead getGroupsId(id)
Find group by ID
Returns a single group 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 = GroupsApi();
final id = 1; // int | The ID of the resource
try {
final result = api_instance.getGroupsId(id);
print(result);
} catch (e) {
print('Exception when calling GroupsApi->getGroupsId: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | The ID of the resource |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List getGroupsIdTwofaccounts(withSecret)
Get all 2FA accounts of a group
Finds all existing 2FA accounts assigned to a group 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 = GroupsApi();
final withSecret = true; // bool | Set to true (or 1) to append the Secret property to the returned 2FA account
try {
final result = api_instance.getGroupsIdTwofaccounts(withSecret);
print(result);
} catch (e) {
print('Exception when calling GroupsApi->getGroupsIdTwofaccounts: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
withSecret | bool | Set to true (or 1) to append the Secret property to the returned 2FA account | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupRead postGroups(groupStore)
Create Group
Creates a new group for 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 = GroupsApi();
final groupStore = GroupStore(); // GroupStore |
try {
final result = api_instance.postGroups(groupStore);
print(result);
} catch (e) {
print('Exception when calling GroupsApi->postGroups: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
groupStore | GroupStore | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupRead postGroupsIdAssign(id, postGroupsIdAssignRequest)
Add 2FA accounts to a group
Adds a list of 2FA accounts to a group of the authenticated user. An account previously assigned to another group will be removed from its former group. The 2FA accounts must be owned by 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 = GroupsApi();
final id = 1; // int | The ID of the resource
final postGroupsIdAssignRequest = PostGroupsIdAssignRequest(); // PostGroupsIdAssignRequest |
try {
final result = api_instance.postGroupsIdAssign(id, postGroupsIdAssignRequest);
print(result);
} catch (e) {
print('Exception when calling GroupsApi->postGroupsIdAssign: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | The ID of the resource | |
postGroupsIdAssignRequest | PostGroupsIdAssignRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupRead putGroupsId(id, groupStore)
Update group
Updates a group 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 = GroupsApi();
final id = 1; // int | The ID of the resource
final groupStore = GroupStore(); // GroupStore |
try {
final result = api_instance.putGroupsId(id, groupStore);
print(result);
} catch (e) {
print('Exception when calling GroupsApi->putGroupsId: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | The ID of the resource | |
groupStore | GroupStore | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]