pibtool_stock_data/data_source/
session_net_data_source.rs1use std::collections::BTreeMap;
7
8use serde::{Deserialize, Serialize};
9use url::Url;
10
11use crate::DocumentKind;
12
13use super::DataSourceInfo;
14
15#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
17pub struct SessionNetDataSource {
18 pub url: Url,
20
21 pub municipal_council_name: String,
23
24 pub contained_documents: BTreeMap<DocumentKind, SessionNetDocumentsConfiguration>,
26}
27
28impl DataSourceInfo for SessionNetDataSource {
29 fn is_download_supported(&self) -> bool {
30 true
31 }
32
33 fn provides_documents(&self, document_kind: DocumentKind) -> bool {
34 self.contained_documents.keys().any(|k| k == &document_kind)
35 }
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
40pub struct SessionNetDocumentsConfiguration {
41 pub matching_label_regexes: Vec<String>,
43}