Skip to content

Latest commit

 

History

History
260 lines (181 loc) · 8.16 KB

SettingsApi.md

File metadata and controls

260 lines (181 loc) · 8.16 KB

openapi.api.SettingsApi

Load the API package

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

deleteSettingsName(name)

Delete custom setting

Deletes a custom application setting. Settings endpoints are restricted to user with an Administrator role.

Example

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');
}

Parameters

Name Type Description Notes
name String Name of the resource

Return type

void (empty response body)

Authorization

Bearer-Auth

HTTP request headers

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

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

getSettings

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.

Example

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');
}

Parameters

This endpoint does not need any parameter.

Return type

List

Authorization

Bearer-Auth

HTTP request headers

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

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

getSettingsName

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.

Example

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');
}

Parameters

Name Type Description Notes
name String Name of the resource

Return type

Setting

Authorization

Bearer-Auth

HTTP request headers

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

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

postSettings

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.

Example

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');
}

Parameters

Name Type Description Notes
setting Setting [optional]

Return type

Setting

Authorization

Bearer-Auth

HTTP request headers

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

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

putSettingsName

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.

Example

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');
}

Parameters

Name Type Description Notes
name String Name of the resource
putSettingsNameRequest PutSettingsNameRequest [optional]

Return type

Setting

Authorization

Bearer-Auth

HTTP request headers

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

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