Skip to content

Latest commit

 

History

History
1003 lines (704 loc) · 32.5 KB

DeviceApi.md

File metadata and controls

1003 lines (704 loc) · 32.5 KB

forestvpn_api.api.DeviceApi

Load the API package

import 'package:forestvpn_api/api.dart';

All URIs are relative to https://api.forestvpn.com/v2

Method HTTP request Description
createDevice POST /devices/ Create new device
createDeviceAvdertisedRoute POST /devices/{deviceID}/advertised-routes/ Create new device advertised routes
createDevicePortForwarding POST /devices/{deviceID}/port-forwarding/ Create new device port forwarding
deleteDevice DELETE /devices/{deviceID}/ Delete Device
deleteDevicePortForwarding DELETE /devices/{deviceID}/port-forwarding/{portForwardingID}/ Delete Device's Port Forwarding
getDevice GET /devices/{deviceID}/ Device Info
getDeviceStats GET /devices/{deviceID}/stats/{statsID}/ Device's stats detail
getDeviceWireGuard GET /devices/{deviceID}/wireguards/{wireGuardID}/ Device's wireguard profile detail
getWireGuardConf GET /devices/{deviceID}/wireguard.conf Wireguard conf
listDeviceAdvertisedRoutes GET /devices/{deviceID}/advertised-routes/ Device advertised routes List
listDeviceBindings GET /devices/{deviceID}/bindings/ Device bindings
listDeviceConnectionModes GET /devices/{deviceID}/connection-modes/ Device connection modes
listDeviceDetailStats GET /devices/{deviceID}/detail-stats/ Device's detail stats list
listDevicePortForwardings GET /devices/{deviceID}/port-forwarding/ Device Port Forwarding List
listDeviceStats GET /devices/{deviceID}/stats/ Device's stats list
listDeviceWireGuardPeers GET /devices/{deviceID}/wireguards/{wireGuardID}/peers/ Device's wireguard peers
listDeviceWireGuards GET /devices/{deviceID}/wireguards/ Device's wireguard profiles list
listDevices GET /devices/ Device List
updateDevice PATCH /devices/{deviceID}/ Update device properties
updateDevicePortForwarding PATCH /devices/{deviceID}/port-forwarding/{portForwardingID}/ Update device's port forwarding

createDevice

Device createDevice(createOrUpdateDeviceRequest)

Create new device

Create new device

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final CreateOrUpdateDeviceRequest createOrUpdateDeviceRequest = ; // CreateOrUpdateDeviceRequest | 

try {
    final response = api.createDevice(createOrUpdateDeviceRequest);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->createDevice: $e\n');
}

Parameters

Name Type Description Notes
createOrUpdateDeviceRequest CreateOrUpdateDeviceRequest [optional]

Return type

Device

Authorization

bearerAuth

HTTP request headers

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

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

createDeviceAvdertisedRoute

AdvertisedRoute createDeviceAvdertisedRoute(deviceID, advertisedRoute)

Create new device advertised routes

Create new device avdertised route

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final AdvertisedRoute advertisedRoute = ; // AdvertisedRoute | 

try {
    final response = api.createDeviceAvdertisedRoute(deviceID, advertisedRoute);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->createDeviceAvdertisedRoute: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
advertisedRoute AdvertisedRoute [optional]

Return type

AdvertisedRoute

Authorization

bearerAuth

HTTP request headers

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

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

createDevicePortForwarding

PortForwarding createDevicePortForwarding(deviceID, createOrUpdatePortForwardingRequest)

Create new device port forwarding

Create new device port forwarding

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final CreateOrUpdatePortForwardingRequest createOrUpdatePortForwardingRequest = ; // CreateOrUpdatePortForwardingRequest | 

try {
    final response = api.createDevicePortForwarding(deviceID, createOrUpdatePortForwardingRequest);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->createDevicePortForwarding: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
createOrUpdatePortForwardingRequest CreateOrUpdatePortForwardingRequest [optional]

Return type

PortForwarding

Authorization

bearerAuth

HTTP request headers

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

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

deleteDevice

deleteDevice(deviceID)

Delete Device

Delete device by id

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    api.deleteDevice(deviceID);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->deleteDevice: $e\n');
}

Parameters

Name Type Description Notes
deviceID String

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

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

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

deleteDevicePortForwarding

deleteDevicePortForwarding(deviceID, portForwardingID)

Delete Device's Port Forwarding

Delete device's port forwarding by id

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final String portForwardingID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    api.deleteDevicePortForwarding(deviceID, portForwardingID);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->deleteDevicePortForwarding: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
portForwardingID String

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

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

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

getDevice

Device getDevice(deviceID)

Device Info

Retrieve device info

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getDevice(deviceID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->getDevice: $e\n');
}

Parameters

Name Type Description Notes
deviceID String

Return type

Device

Authorization

bearerAuth

HTTP request headers

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

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

getDeviceStats

DeviceStats getDeviceStats(deviceID, statsID)

Device's stats detail

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final String statsID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getDeviceStats(deviceID, statsID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->getDeviceStats: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
statsID String

Return type

DeviceStats

Authorization

bearerAuth

HTTP request headers

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

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

getDeviceWireGuard

WireGuard getDeviceWireGuard(deviceID, wireGuardID)

Device's wireguard profile detail

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final String wireGuardID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getDeviceWireGuard(deviceID, wireGuardID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->getDeviceWireGuard: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
wireGuardID String

Return type

WireGuard

Authorization

bearerAuth

HTTP request headers

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

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

getWireGuardConf

String getWireGuardConf(deviceID)

Wireguard conf

Wireguard conf as plain text

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getWireGuardConf(deviceID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->getWireGuardConf: $e\n');
}

Parameters

Name Type Description Notes
deviceID String

Return type

String

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain, application/json

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

listDeviceAdvertisedRoutes

BuiltList listDeviceAdvertisedRoutes(deviceID, perPage, page)

Device advertised routes List

Retrieve device's advertised routes list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final int perPage = 56; // int | 
final int page = 56; // int | 

try {
    final response = api.listDeviceAdvertisedRoutes(deviceID, perPage, page);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDeviceAdvertisedRoutes: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
perPage int [optional]
page int [optional]

Return type

BuiltList<AdvertisedRoute>

Authorization

bearerAuth

HTTP request headers

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

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

listDeviceBindings

BuiltList listDeviceBindings(deviceID)

Device bindings

Each device has bindings to specific servers. This methods returns hostnames where this device binded in a particular time.

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.listDeviceBindings(deviceID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDeviceBindings: $e\n');
}

Parameters

Name Type Description Notes
deviceID String

Return type

BuiltList<String>

Authorization

bearerAuth

HTTP request headers

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

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

listDeviceConnectionModes

BuiltList listDeviceConnectionModes(deviceID, xAndroidPackage, xAndroidSHA1)

Device connection modes

This methods returns list of connection modes are availbale for current device.

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final String xAndroidPackage = xAndroidPackage_example; // String | 
final String xAndroidSHA1 = xAndroidSHA1_example; // String | 

try {
    final response = api.listDeviceConnectionModes(deviceID, xAndroidPackage, xAndroidSHA1);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDeviceConnectionModes: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
xAndroidPackage String [optional]
xAndroidSHA1 String [optional]

Return type

BuiltList<ConnectionMode>

Authorization

bearerAuth

HTTP request headers

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

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

listDeviceDetailStats

BuiltList listDeviceDetailStats(deviceID, dateTimeAfter, dateTimeBefore, perPage, page)

Device's detail stats list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final String dateTimeAfter = dateTimeAfter_example; // String | 
final String dateTimeBefore = dateTimeBefore_example; // String | 
final int perPage = 56; // int | 
final int page = 56; // int | 

try {
    final response = api.listDeviceDetailStats(deviceID, dateTimeAfter, dateTimeBefore, perPage, page);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDeviceDetailStats: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
dateTimeAfter String [optional]
dateTimeBefore String [optional]
perPage int [optional]
page int [optional]

Return type

BuiltList<DeviceStats>

Authorization

bearerAuth

HTTP request headers

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

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

listDevicePortForwardings

BuiltList listDevicePortForwardings(deviceID, perPage, page)

Device Port Forwarding List

Retrieve device's port forwarding lis

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final int perPage = 56; // int | 
final int page = 56; // int | 

try {
    final response = api.listDevicePortForwardings(deviceID, perPage, page);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDevicePortForwardings: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
perPage int [optional]
page int [optional]

Return type

BuiltList<PortForwarding>

Authorization

bearerAuth

HTTP request headers

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

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

listDeviceStats

BuiltList listDeviceStats(deviceID, dateAfter, dateBefore, perPage, page)

Device's stats list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final Date dateAfter = 2013-10-20; // Date | 
final Date dateBefore = 2013-10-20; // Date | 
final int perPage = 56; // int | 
final int page = 56; // int | 

try {
    final response = api.listDeviceStats(deviceID, dateAfter, dateBefore, perPage, page);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDeviceStats: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
dateAfter Date [optional]
dateBefore Date [optional]
perPage int [optional]
page int [optional]

Return type

BuiltList<DeviceStats>

Authorization

bearerAuth

HTTP request headers

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

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

listDeviceWireGuardPeers

BuiltList listDeviceWireGuardPeers(deviceID, wireGuardID)

Device's wireguard peers

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final String wireGuardID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.listDeviceWireGuardPeers(deviceID, wireGuardID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDeviceWireGuardPeers: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
wireGuardID String

Return type

BuiltList<WireGuardPeer>

Authorization

bearerAuth

HTTP request headers

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

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

listDeviceWireGuards

BuiltList listDeviceWireGuards(deviceID, perPage, page)

Device's wireguard profiles list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final int perPage = 56; // int | 
final int page = 56; // int | 

try {
    final response = api.listDeviceWireGuards(deviceID, perPage, page);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDeviceWireGuards: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
perPage int [optional]
page int [optional]

Return type

BuiltList<WireGuard>

Authorization

bearerAuth

HTTP request headers

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

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

listDevices

BuiltList listDevices(q, externalKey, recentlyActive, lastActiveAtAfter, lastActiveAtBefore, sort, perPage, page)

Device List

Retrieve devices list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String q = q_example; // String | Filter by search query
final String externalKey = externalKey_example; // String | Filter by external_key
final bool recentlyActive = true; // bool | Filter by recently active
final DateTime lastActiveAtAfter = 2013-10-20T19:20:30+01:00; // DateTime | Filter by last active at date-time after provided value
final DateTime lastActiveAtBefore = 2013-10-20T19:20:30+01:00; // DateTime | Filter by last active at date-time before provided value
final String sort = sort_example; // String | Sort by provided field
final int perPage = 56; // int | 
final int page = 56; // int | 

try {
    final response = api.listDevices(q, externalKey, recentlyActive, lastActiveAtAfter, lastActiveAtBefore, sort, perPage, page);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->listDevices: $e\n');
}

Parameters

Name Type Description Notes
q String Filter by search query [optional]
externalKey String Filter by external_key [optional]
recentlyActive bool Filter by recently active [optional]
lastActiveAtAfter DateTime Filter by last active at date-time after provided value [optional]
lastActiveAtBefore DateTime Filter by last active at date-time before provided value [optional]
sort String Sort by provided field [optional]
perPage int [optional]
page int [optional]

Return type

BuiltList<Device>

Authorization

bearerAuth

HTTP request headers

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

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

updateDevice

Device updateDevice(deviceID, createOrUpdateDeviceRequest)

Update device properties

Update device properties

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final CreateOrUpdateDeviceRequest createOrUpdateDeviceRequest = ; // CreateOrUpdateDeviceRequest | 

try {
    final response = api.updateDevice(deviceID, createOrUpdateDeviceRequest);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->updateDevice: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
createOrUpdateDeviceRequest CreateOrUpdateDeviceRequest

Return type

Device

Authorization

bearerAuth

HTTP request headers

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

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

updateDevicePortForwarding

PortForwarding updateDevicePortForwarding(deviceID, portForwardingID, createOrUpdatePortForwardingRequest)

Update device's port forwarding

Update device's port forwarding dst_port

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getDeviceApi();
final String deviceID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final String portForwardingID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final CreateOrUpdatePortForwardingRequest createOrUpdatePortForwardingRequest = ; // CreateOrUpdatePortForwardingRequest | 

try {
    final response = api.updateDevicePortForwarding(deviceID, portForwardingID, createOrUpdatePortForwardingRequest);
    print(response);
} catch on DioError (e) {
    print('Exception when calling DeviceApi->updateDevicePortForwarding: $e\n');
}

Parameters

Name Type Description Notes
deviceID String
portForwardingID String
createOrUpdatePortForwardingRequest CreateOrUpdatePortForwardingRequest

Return type

PortForwarding

Authorization

bearerAuth

HTTP request headers

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

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