apt-api-types: derive PartialEq for all types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer 2024-07-09 13:15:16 +02:00
parent 54dcb0942c
commit 7ae351854e

View File

@ -47,7 +47,7 @@ serde_plain::derive_fromstr_from_deserialize!(APTRepositoryPackageType);
}, },
}, },
)] )]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "PascalCase")] // for consistency #[serde(rename_all = "PascalCase")] // for consistency
/// Additional options for an APT repository. /// Additional options for an APT repository.
/// Used for both single- and mutli-value options. /// Used for both single- and mutli-value options.
@ -112,7 +112,7 @@ pub struct APTRepositoryOption {
}, },
}, },
)] )]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "PascalCase")] #[serde(rename_all = "PascalCase")]
/// Describes an APT repository. /// Describes an APT repository.
pub struct APTRepository { pub struct APTRepository {
@ -166,7 +166,7 @@ pub struct APTRepository {
}, },
}, },
)] )]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
/// Represents an abstract APT repository file. /// Represents an abstract APT repository file.
pub struct APTRepositoryFile { pub struct APTRepositoryFile {
@ -190,7 +190,7 @@ pub struct APTRepositoryFile {
} }
#[api] #[api]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
/// Error type for problems with APT repository files. /// Error type for problems with APT repository files.
pub struct APTRepositoryFileError { pub struct APTRepositoryFileError {
@ -294,7 +294,7 @@ serde_plain::derive_display_from_serialize!(APTRepositoryHandle);
serde_plain::derive_fromstr_from_deserialize!(APTRepositoryHandle); serde_plain::derive_fromstr_from_deserialize!(APTRepositoryHandle);
#[api()] #[api()]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "PascalCase")] #[serde(rename_all = "PascalCase")]
/// Describes a package for which an update is available. /// Describes a package for which an update is available.
pub struct APTUpdateInfo { pub struct APTUpdateInfo {
@ -333,7 +333,7 @@ pub struct APTUpdateInfo {
}, },
} }
)] )]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
/// Options for APT update /// Options for APT update
pub struct APTUpdateOptions { pub struct APTUpdateOptions {
/// Send notification mail about new package updates available to the email /// Send notification mail about new package updates available to the email
@ -374,7 +374,7 @@ pub struct APTUpdateOptions {
}, },
}, },
)] )]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
/// Result from parsing the APT repository files in /etc/apt/. /// Result from parsing the APT repository files in /etc/apt/.
pub struct APTRepositoriesResult { pub struct APTRepositoriesResult {
@ -390,7 +390,7 @@ pub struct APTRepositoriesResult {
} }
#[api()] #[api()]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
/// Options for the get changelog API. /// Options for the get changelog API.
pub struct APTGetChangelogOptions { pub struct APTGetChangelogOptions {
/// Package name to get changelog of. /// Package name to get changelog of.
@ -400,7 +400,7 @@ pub struct APTGetChangelogOptions {
} }
#[api()] #[api()]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
/// Options for the change repository API call /// Options for the change repository API call
pub struct APTChangeRepositoryOptions { pub struct APTChangeRepositoryOptions {
/// Whether the repository should be enabled or not. /// Whether the repository should be enabled or not.