steam_client/services/
store.rs1use crate::{error::SteamError, SteamClient};
7
8#[derive(Debug, Clone)]
10pub struct StoreTag {
11 pub tagid: u32,
13 pub english_name: Option<String>,
15 pub name: Option<String>,
17 pub normalized_name: Option<String>,
19}
20
21impl SteamClient {
22 pub async fn get_store_tag_names(&mut self, language: &str, tag_ids: &[u32]) -> Result<Vec<StoreTag>, SteamError> {
32 if !self.is_logged_in() {
33 return Err(SteamError::NotLoggedOn);
34 }
35
36 let request = steam_protos::CStoreGetLocalizedNameForTagsRequest { language: Some(language.to_string()), tagids: tag_ids.to_vec() };
37
38 let response: steam_protos::CStoreGetLocalizedNameForTagsResponse = self.send_unified_request_and_wait("Store.GetLocalizedNameForTags#1", &request).await?;
39
40 let mut tags = Vec::new();
41 for tag in response.tags {
42 tags.push(StoreTag {
43 tagid: tag.tagid.unwrap_or(0),
44 english_name: tag.english_name,
45 name: tag.name,
46 normalized_name: tag.normalized_name,
47 });
48 }
49
50 Ok(tags)
51 }
52}