winget_types/locale/
agreement.rs1use alloc::string::String;
2
3use url::Url;
4
5#[derive(Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
6#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7#[cfg_attr(feature = "serde", serde(rename_all = "PascalCase"))]
8pub struct Agreement {
9 #[cfg_attr(
11 feature = "serde",
12 serde(rename = "AgreementLabel", skip_serializing_if = "Option::is_none")
13 )]
14 pub label: Option<String>,
15
16 #[cfg_attr(
18 feature = "serde",
19 serde(rename = "Agreement", skip_serializing_if = "Option::is_none")
20 )]
21 pub text: Option<String>,
22
23 #[cfg_attr(
25 feature = "serde",
26 serde(rename = "AgreementUrl", skip_serializing_if = "Option::is_none")
27 )]
28 pub url: Option<Url>,
29}
30
31impl Agreement {
32 #[must_use]
45 pub const fn is_empty(&self) -> bool {
46 self.label.is_none() && self.text.is_none() && self.url.is_none()
47 }
48}