Function valorant_api::get_account_aliases
source · pub async fn get_account_aliases<T: HttpClient>(
credentials_manager: &CredentialsManager,
http_client: &T,
cluster: &str,
game_name: Option<&str>,
tag_line: Option<&str>
) -> Result<AccountAliasesV1, RequestError>
Expand description
Get the account aliases of a player. This can be used to search for an account by game name and/or tag_line and get their puuid.
§Arguments
credentials_manager
- The credentials managerhttp_client
- The http clientcluster
- The cluster of the playergame_name
- The game name of the playertag_line
- The tag line of the player
§Errors
RequestError
- If the request failed
§Example
let result = valorant_api::get_account_aliases(credentials_manager, &http_client, "eu", None, None).await;
println!("Result: {:#?}", result);
Examples found in repository?
examples/account_aliases.rs (line 12)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
async fn main() {
let http_client = get_http_client().expect("Error while creating http client");
let credentials_manager = get_credentials_manager(&http_client)
.await
.expect("Error while getting credentials manager");
let result =
valorant_api::get_account_aliases(&credentials_manager, &http_client, "eu", None, None)
.await;
println!("Result: {:#?}", result);
assert!(result.is_ok());
let result = valorant_api::get_account_aliases(
&credentials_manager,
&http_client,
"eu",
Some("Dirtyhexe"),
None,
)
.await;
println!("Result: {:#?}", result);
assert!(result.is_ok());
let result = valorant_api::get_account_aliases(
&credentials_manager,
&http_client,
"eu",
Some("Dirtyhexe"),
Some("3885"),
)
.await;
println!("Result: {:#?}", result);
assert!(result.is_ok());
}