connpass_rs/
response.rs

1//! Represents the response from connpass API.
2//! For more details in https://connpass.com/about/api/.
3//! The data class is along with the specification.
4
5use serde::{Deserialize, Serialize};
6
7#[derive(Serialize, Deserialize, PartialEq, Clone, Debug)]
8pub struct ConnpassResponse {
9    results_returned: u32,
10    results_available: u32,
11    results_start: u32,
12    events: Vec<Event>,
13}
14
15#[derive(Serialize, Deserialize, PartialEq, Clone, Debug)]
16pub struct Event {
17    event_id: u32,
18    title: Option<String>,
19    catch: Option<String>,
20    description: Option<String>,
21    event_url: Option<String>,
22    hash_tag: Option<String>,
23    started_at: Option<String>,
24    ended_at: Option<String>,
25    limit: Option<u32>,
26    event_type: Option<EventType>,
27    series: Option<Series>,
28    address: Option<String>,
29    place: Option<String>,
30    lat: Option<String>,
31    lon: Option<String>,
32    owner_id: Option<u32>,
33    owner_nickname: Option<String>,
34    owner_display_name: Option<String>,
35    accepted: Option<u32>,
36    waiting: Option<u32>,
37    updated_at: Option<String>,
38}
39
40#[derive(Serialize, Deserialize, PartialEq, Clone, Debug)]
41pub enum EventType {
42    #[serde(rename = "participation")]
43    Participation,
44    #[serde(rename = "advertisement")]
45    Advertisement,
46}
47
48#[derive(Serialize, Deserialize, PartialEq, Clone, Debug)]
49pub struct Series {
50    id: u32,
51    title: Option<String>,
52    url: Option<String>,
53}