Table of Contents

Class VpnProfileInfo

Namespace
VpnHood.AppLib.Api.VpnProfiles
Assembly
VpnHood.AppLib.Api.dll

Represents a VPN profile as the UI reads it, for the client's country: the policy and the locations depend on it.

public class VpnProfileInfo
Inheritance
VpnProfileInfo
Inherited Members

Properties

AccessCode

Gets the VPN profile's premium code, with most of it masked, or null.

public required string? AccessCode { get; init; }

Property Value

string

AccessCodeRefusal

Gets the access server's refusal of the profile's premium code, until a connect succeeds or the code changes or is removed, or null.

public required AccessCodeRefusal? AccessCodeRefusal { get; init; }

Property Value

AccessCodeRefusal

CanGoPremium

Gets a value indicating whether the server's policy lets the person go premium, by a premium code or a purchase.

public required bool CanGoPremium { get; init; }

Property Value

bool

CanImportAccessCode

Gets a value indicating whether a premium code can be typed for this VPN profile: the operator's policy allows it, and so does the build (AllowImportAccessCode).

public required bool CanImportAccessCode { get; init; }

Property Value

bool

Remarks

It is not the location's PremiumByCode, which is false for a profile that is premium already: that one tells whether a person can go premium, while a change of code is offered to those who are.

CanTryPremium

Gets a value indicating whether the server's policy offers a premium trial.

public required bool CanTryPremium { get; init; }

Property Value

bool

CanViewAccessCode

Gets a value indicating whether the premium code this device holds may be shown, as the operator's policy alone says.

public required bool CanViewAccessCode { get; init; }

Property Value

bool

Remarks

A store that forbids unlocking the app with a typed code does not forbid a buyer to read the code their purchase made, for the devices that take it: an App Store build shows the code, and offers no box to type one.

ClientPolicy

Gets the access key's policy for the client's country, or for any country, or null.

public required ClientPolicy? ClientPolicy { get; init; }

Property Value

ClientPolicy

CustomData

Gets the text a UI keeps with the VPN profile, or null.

public required string? CustomData { get; init; }

Property Value

string

CustomServerEndpoints

Gets the server's addresses the person gave, used instead of the access key's where enabled, or null.

[JsonConverter(typeof(ArrayConverter<IPEndPoint, IPEndPointConverter>))]
public required IPEndPoint[]? CustomServerEndpoints { get; init; }

Property Value

IPEndPoint[]

HostNames

Gets the access key's host name and server addresses, partly masked for display.

public required IReadOnlyList<string> HostNames { get; init; }

Property Value

IReadOnlyList<string>

IsBuiltIn

Gets a value indicating whether the app brought the VPN profile with it, rather than the person adding it.

public required bool IsBuiltIn { get; init; }

Property Value

bool

IsCustomServerEndpointsEnabled

Gets a value indicating whether the VPN profile connects to CustomServerEndpoints.

public required bool IsCustomServerEndpointsEnabled { get; init; }

Property Value

bool

IsPremium

Gets a value indicating whether the VPN profile is premium.

public required bool IsPremium { get; init; }

Property Value

bool

IsPremiumLocationSelected

Gets a value indicating whether the person chose a premium location.

public required bool IsPremiumLocationSelected { get; init; }

Property Value

bool

IsValidHostName

Gets a value indicating whether the access key's host name is a valid one, which a DNS lookup can find.

public required bool IsValidHostName { get; init; }

Property Value

bool

LocationInfos

Gets the server locations the person may pick, for the client's country.

public required IReadOnlyList<ServerLocationItem> LocationInfos { get; init; }

Property Value

IReadOnlyList<ServerLocationItem>

SelectedLocationInfo

Gets the server location a connect goes to: the one the person chose, else the automatic one, else the first; or null where the VPN profile has none.

public required ServerLocationItem? SelectedLocationInfo { get; init; }

Property Value

ServerLocationItem

SupportId

Gets the access key's support ID, which the server's operator knows it by, or null.

public required string? SupportId { get; init; }

Property Value

string

TokenId

Gets the access key's ID.

public required string TokenId { get; init; }

Property Value

string

VpnProfileId

Gets the VPN profile's ID.

public required Guid VpnProfileId { get; init; }

Property Value

Guid

VpnProfileName

Gets the VPN profile's name, as the person named it or the access key does.

public required string VpnProfileName { get; init; }

Property Value

string

Methods

HasMultipleRegion(string)

Gets whether the VPN profile's locations have more than one region in a country.

public bool HasMultipleRegion(string countryCode)

Parameters

countryCode string

The country's two-letter code.

Returns

bool

true where the country's locations have regions to pick.