Skip to main content

uk_police_api/models/
force.rs

1use serde::{Deserialize, Serialize};
2
3/// A summary of a police force.
4#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
5pub struct Force {
6    /// Unique force identifier.
7    pub id: String,
8    /// Force name.
9    pub name: String,
10}
11
12/// Detailed information about a specific police force.
13#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
14pub struct ForceDetail {
15    /// Unique force identifier.
16    pub id: String,
17    /// Force name.
18    pub name: String,
19    /// Description of the force.
20    pub description: Option<String>,
21    /// Force website URL.
22    pub url: Option<String>,
23    /// Force telephone number.
24    pub telephone: Option<String>,
25    /// Ways to keep informed about the force.
26    pub engagement_methods: Vec<EngagementMethod>,
27}
28
29/// A senior officer of a police force.
30#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
31pub struct SeniorOfficer {
32    /// Name of the officer.
33    pub name: String,
34    /// Force rank (e.g. "Chief Constable").
35    pub rank: String,
36    /// Officer biography, if available.
37    pub bio: Option<String>,
38    /// Contact details for the officer.
39    pub contact_details: ContactDetails,
40}
41
42/// Contact details for a senior officer.
43#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
44pub struct ContactDetails {
45    pub email: Option<String>,
46    pub telephone: Option<String>,
47    pub mobile: Option<String>,
48    pub fax: Option<String>,
49    pub web: Option<String>,
50    pub address: Option<String>,
51    pub facebook: Option<String>,
52    pub twitter: Option<String>,
53    pub youtube: Option<String>,
54    pub myspace: Option<String>,
55    pub bebo: Option<String>,
56    pub flickr: Option<String>,
57    #[serde(rename = "google-plus")]
58    pub google_plus: Option<String>,
59    pub forum: Option<String>,
60    #[serde(rename = "e-messaging")]
61    pub e_messaging: Option<String>,
62    pub blog: Option<String>,
63    pub rss: Option<String>,
64}
65
66/// A way to engage with a police force (e.g. Twitter, Facebook, website).
67#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
68pub struct EngagementMethod {
69    /// The type of engagement method (e.g. "facebook", "twitter", "rss").
70    #[serde(rename = "type")]
71    pub kind: String,
72    /// Method title.
73    pub title: Option<String>,
74    /// Method description.
75    pub description: Option<String>,
76    /// Method website URL.
77    pub url: Option<String>,
78}