# AccountId

> Reference the AccountId class for representing Vivox user accounts.

[More...](#detailed-description)

`#include <AccountId.h>`

## Public Functions

|                            | Name                                                                                                                                                                                                                                                                                                                                                                |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AccountId                  | **[CreateFromUri](#function-createfromuri)**(const FString & uri, const TOptional\< FString > & displayName =TOptional\< FString >(), const TOptional\< FString > & unityEnvironmentId =TOptional\< FString >())Create an AccountId from a URI. Note: Internal use only.                                                                                            |
| FString                    | **[AccountNameFromUri](#function-accountnamefromuri)**(const FString & uri, const TOptional\< FString > & unityEnvironmentId =TOptional\< FString >())A shortcut for AccountId::CreateFromUri(uri).Name(). Note: Internal use only.                                                                                                                                 |
| bool                       | **[IsNullOrEmpty](#function-isnullorempty)**(AccountId \* id)True if ID is null or empty.                                                                                                                                                                                                                                                                           |
|                            | **[AccountId](#function-accountid)**()Default constructor.                                                                                                                                                                                                                                                                                                          |
|                            | **[AccountId](#function-accountid)**(const FString & issuer, const FString & name, const FString & domain, const TOptional\< FString > & displayName =TOptional\< FString >(), const TOptional\< TArray\< FString > > & spokenLanguages =TOptional\< TArray\< FString > >(), const TOptional\< FString > & unityEnvironmentId =TOptional\< FString >())Constructor. |
| const FString &            | **[Issuer](#function-issuer)**() constThe issuer that is responsible for authenticating this account.                                                                                                                                                                                                                                                               |
| const FString &            | **[Name](#function-name)**() constThe unique account name that you assigned to the player.                                                                                                                                                                                                                                                                          |
| const FString &            | **[Domain](#function-domain)**() constThe Vivox domain that provides service for this account.                                                                                                                                                                                                                                                                      |
| const FString &            | **[DisplayName](#function-displayname)**() constAn optional display name that is seen by others. The default is an empty string.                                                                                                                                                                                                                                    |
| const TArray\< FString > & | **[SpokenLanguages](#function-spokenlanguages)**() constAn optional array of languages used as hints for audio transcription. The default is an empty array, which implies "en".                                                                                                                                                                                    |
| const FString &            | **[UnityEnvironmentId](#function-unityenvironmentid)**() constThe Unity Environment of the UGS Project.                                                                                                                                                                                                                                                             |
| bool                       | **[IsEmpty](#function-isempty)**() constTrue if Issuer, Name, and Domain are all empty.                                                                                                                                                                                                                                                                             |
| bool                       | **[IsValid](#function-isvalid)**() constTrue if Issuer and Domain are non-empty, and Name meets restrictions.                                                                                                                                                                                                                                                       |
| FString                    | **[ToString](#function-tostring)**() constInternal use only.                                                                                                                                                                                                                                                                                                        |

## Detailed Description

```cpp
class AccountId;
```

The unique identifier for a player that accesses a Vivox instance.

## Public Functions Documentation

### function CreateFromUri

```cpp
static AccountId CreateFromUri(
    const FString & uri,
    const TOptional< FString > & displayName =TOptional< FString >(),
    const TOptional< FString > & unityEnvironmentId =TOptional< FString >()
)
```

Create an `AccountId` from a URI. Note: Internal use only.

**Parameters**:

* **uri** The URI of the account.
* **displayName** An optional display name that is seen by others. The default is an empty string.

**Return**: The `AccountId()`.

### function AccountNameFromUri

```cpp
static FString AccountNameFromUri(
    const FString & uri,
    const TOptional< FString > & unityEnvironmentId =TOptional< FString >()
)
```

A shortcut for AccountId::CreateFromUri(uri).`Name()`. Note: Internal use only.

**Parameters**:

* **uri** The URI of the account.

**Return**: The name returned from an \[AccountId] created with a URI.

### function IsNullOrEmpty

```cpp
static bool IsNullOrEmpty(
    AccountId * id
)
```

True if ID is null or empty.

### function AccountId

```cpp
AccountId()
```

Default constructor.

### function AccountId

```cpp
AccountId(
    const FString & issuer,
    const FString & name,
    const FString & domain,
    const TOptional< FString > & displayName =TOptional< FString >(),
    const TOptional< TArray< FString > > & spokenLanguages =TOptional< TArray< FString > >(),
    const TOptional< FString > & unityEnvironmentId =TOptional< FString >()
)
```

Constructor.

**Parameters**:

* **issuer** The issuer that is responsible for authenticating this account.
* **name** The unique account name that you assigned to the player.
* **domain** The Vivox domain that provides service for this account, for example: mt1s.vivox.com.
* **displayName** An optional display name that is seen by others. The default is an empty string.
* **spokenLanguages** An optional array of languages used as hints for audio transcription. The default is an empty array, which implies "en".
* **unityEnvironmentId** The Unity Environment Id, from the Unity Dashboard, to be embedded in the Accounts URI, primarily for Moderation requests

**Remark**: The combined length of 'Issuer' + 'Name' must not exceed 124 characters. The DisplayName must not exceed 63 characters. Name and DisplayName can only use the letters A-Z and a-z, the numbers 0-9, and the special characters =+-\_.!\~()% You can specify up to three spoken languages in order of preference to inform transcription of all users in transcribed channels. Note: IETF language tag strings are not validated, but are expected to conform to BCP 47 ([https://tools.ietf.org/html/bcp47](https://tools.ietf.org/html/bcp47)).

### function Issuer

```cpp
const FString & Issuer() const
```

The issuer that is responsible for authenticating this account.

### function Name

```cpp
const FString & Name() const
```

The unique account name that you assigned to the player.

**Remark**: This is the value the SDK uses internally to identify the user. To ensure character requirements, this typically matches the game or online ID of the player, or a hash of it.

### function Domain

```cpp
const FString & Domain() const
```

The Vivox domain that provides service for this account.

### function DisplayName

```cpp
const FString & DisplayName() const
```

An optional display name that is seen by others. The default is an empty string.

**Remark**: The Vivox SDK makes no use of this value internally. You can use it in your game however you want, such as for example, in rosters or buddy lists. It is not required to be unique.

### function SpokenLanguages

```cpp
const TArray< FString > & SpokenLanguages() const
```

An optional array of languages used as hints for audio transcription. The default is an empty array, which implies "en".

**Remark**: You can specify up to three spoken languages in order of preference to inform transcription of all users in transcribed channels. Note: IETF language tag strings are not validated, but are expected to conform to BCP 47 ([https://tools.ietf.org/html/bcp47](https://tools.ietf.org/html/bcp47)).

### function UnityEnvironmentId

```cpp
const FString & UnityEnvironmentId() const
```

The Unity Environment of the UGS Project.

### function IsEmpty

```cpp
bool IsEmpty() const
```

True if Issuer, Name, and Domain are all empty.

### function IsValid

```cpp
bool IsValid() const
```

True if Issuer and Domain are non-empty, and Name meets restrictions.

### function ToString

```cpp
FString ToString() const
```

Internal use only.
