let jid: Jid = "15551234567@s.whatsapp.net".parse()?;
if let Some(profile) = client.get_business_profile(&jid).await? {
println!("Description: {}", profile.description);
if let Some(email) = &profile.email {
println!("Email: {}", email);
}
for site in &profile.website {
println!("Website: {}", site);
}
if let Some(addr) = &profile.address {
println!("Address: {}", addr);
}
for category in &profile.categories {
println!("Category: {} (ID: {})", category.name, category.id);
}
if let Some(tz) = &profile.business_hours.timezone {
println!("Timezone: {}", tz);
}
if let Some(configs) = &profile.business_hours.business_config {
for config in configs {
println!(
" {}: {} ({}–{})",
config.day_of_week,
config.mode,
config.open_time.as_deref().unwrap_or("N/A"),
config.close_time.as_deref().unwrap_or("N/A"),
);
}
}
} else {
println!("Not a business account");
}