use serde::{Deserialize, Serialize};
use crate::types::files::location::Location;
/// Represents a location to which a chat is connected.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ChatLocation {
/// The location to which the supergroup is connected. Cannot be a live location.
pub location: Location,
/// Location address as defined by the chat owner (1-64 characters).
pub address: String,
}
impl ChatLocation {
/// Creates a new `ChatLocation`.
pub fn new(location: Location, address: impl Into<String>) -> Self {
Self {
location,
address: address.into(),
}
}
}