kcr_edp_epam_com 3.20260531.121040

Kubernetes Custom Resource Bindings
Documentation
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/epam/edp-nexus-operator/edp.epam.com/v1alpha1/nexuscleanuppolicies.yaml
// kopium version: 0.23.0

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
}

use self::prelude::*;

/// NexusCleanupPolicySpec defines the desired state of NexusCleanupPolicy.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)]
#[kube(group = "edp.epam.com", version = "v1alpha1", kind = "NexusCleanupPolicy", plural = "nexuscleanuppolicies")]
#[kube(namespaced)]
#[kube(status = "NexusCleanupPolicyStatus")]
#[kube(schema = "disabled")]
#[kube(derive="PartialEq")]
pub struct NexusCleanupPolicySpec {
    /// Criteria for the cleanup policy.
    pub criteria: NexusCleanupPolicyCriteria,
    /// Description of the cleanup policy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Format that this cleanup policy can be applied to.
    pub format: NexusCleanupPolicyFormat,
    /// Name is a unique name for the cleanup policy.
    pub name: String,
    /// NexusRef is a reference to Nexus custom resource.
    #[serde(rename = "nexusRef")]
    pub nexus_ref: NexusCleanupPolicyNexusRef,
}

/// Criteria for the cleanup policy.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct NexusCleanupPolicyCriteria {
    /// AssetRegex removes components that match the given regex.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "assetRegex")]
    pub asset_regex: Option<String>,
    /// LastBlobUpdated removes components published over “x” days ago.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastBlobUpdated")]
    pub last_blob_updated: Option<i64>,
    /// LastDownloaded removes components downloaded over “x” days.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastDownloaded")]
    pub last_downloaded: Option<i64>,
    /// ReleaseType removes components that are of the following release type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "releaseType")]
    pub release_type: Option<NexusCleanupPolicyCriteriaReleaseType>,
}

/// Criteria for the cleanup policy.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum NexusCleanupPolicyCriteriaReleaseType {
    #[serde(rename = "RELEASES")]
    Releases,
    #[serde(rename = "PRERELEASES")]
    Prereleases,
    #[serde(rename = "")]
    KopiumEmpty,
}

/// NexusCleanupPolicySpec defines the desired state of NexusCleanupPolicy.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum NexusCleanupPolicyFormat {
    #[serde(rename = "apt")]
    Apt,
    #[serde(rename = "bower")]
    Bower,
    #[serde(rename = "cocoapods")]
    Cocoapods,
    #[serde(rename = "conan")]
    Conan,
    #[serde(rename = "conda")]
    Conda,
    #[serde(rename = "docker")]
    Docker,
    #[serde(rename = "gitlfs")]
    Gitlfs,
    #[serde(rename = "go")]
    Go,
    #[serde(rename = "helm")]
    Helm,
    #[serde(rename = "maven2")]
    Maven2,
    #[serde(rename = "npm")]
    Npm,
    #[serde(rename = "nuget")]
    Nuget,
    #[serde(rename = "p2")]
    P2,
    #[serde(rename = "pypi")]
    Pypi,
    #[serde(rename = "r")]
    R,
    #[serde(rename = "raw")]
    Raw,
    #[serde(rename = "rubygems")]
    Rubygems,
    #[serde(rename = "yum")]
    Yum,
}

/// NexusRef is a reference to Nexus custom resource.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct NexusCleanupPolicyNexusRef {
    /// Kind specifies the kind of the Nexus resource.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Name specifies the name of the Nexus resource.
    pub name: String,
}

/// NexusCleanupPolicyStatus defines the observed state of NexusCleanupPolicy.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct NexusCleanupPolicyStatus {
    /// Error is an error message if something went wrong.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Value is a status of the cleanup policy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}