generateVpnConfigWithHttpInfo method

Future<Response> generateVpnConfigWithHttpInfo(
  1. VpnConfig vpnConfig, {
  2. String? uuidToken,
})

Generate VPN configuration

Generates a new VPN configuration. If it already exists, it will be replaced by the new one. If the IP for the VPN connection has not been provided, then the next one with respect to the LAN address will be applied. The provided IP must match the LAN network configuration.

Note: This method returns the HTTP Response.

Parameters:

  • VpnConfig vpnConfig (required):

  • String uuidToken: Used for remote connections to device

Implementation

Future<Response> generateVpnConfigWithHttpInfo(
  VpnConfig vpnConfig, {
  String? uuidToken,
}) async {
  // ignore: prefer_const_declarations
  final path = uuidToken != null
      ? '${LbSetupEnvironment.getApiEndpoint(iotUuid: uuidToken)}/service/vpn/config'
      : '/service/vpn/config';

  // ignore: prefer_final_locals
  Object? postBody = vpnConfig;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}