kcr_oracle_db_anthosapis_com 3.20260118.94513

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/GoogleCloudPlatform/elcarro-oracle-operator/oracle.db.anthosapis.com/v1alpha1/databases.yaml
// kopium version: 0.22.5

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
}
use self::prelude::*;

/// DatabaseSpec defines the desired state of Database.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "oracle.db.anthosapis.com", version = "v1alpha1", kind = "Database", plural = "databases")]
#[kube(namespaced)]
#[kube(status = "DatabaseStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct DatabaseSpec {
    /// AdminPasswordGsmSecretRef is a reference to the secret object containing sensitive information to pass to config agent. This field is optional, and may be empty if plaintext password is used.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "adminPasswordGsmSecretRef")]
    pub admin_password_gsm_secret_ref: Option<DatabaseAdminPasswordGsmSecretRef>,
    /// AdminPassword is the password for the sys admin of the database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub admin_password: Option<String>,
    /// Name of the instance that the database belongs to.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub instance: Option<String>,
    /// Name of the database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Users specifies an optional list of users to be created in this database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub users: Option<Vec<DatabaseUsers>>,
}

/// AdminPasswordGsmSecretRef is a reference to the secret object containing sensitive information to pass to config agent. This field is optional, and may be empty if plaintext password is used.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct DatabaseAdminPasswordGsmSecretRef {
    /// ProjectId identifies the project where the secret resource is.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "projectId")]
    pub project_id: Option<String>,
    /// SecretId identifies the secret.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretId")]
    pub secret_id: Option<String>,
    /// Version is the version of the secret. If "latest" is specified, underlying the latest SecretId is used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// UserSpec defines the desired state of the Database Users.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct DatabaseUsers {
    /// A reference to a GSM secret.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "gsmSecretRef")]
    pub gsm_secret_ref: Option<DatabaseUsersGsmSecretRef>,
    /// Name of the User.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Plaintext password.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub password: Option<String>,
    /// Privileges specifies an optional list of privileges to grant to the user.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub privileges: Option<Vec<String>>,
    /// A reference to a k8s secret.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
    pub secret_ref: Option<DatabaseUsersSecretRef>,
}

/// A reference to a GSM secret.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct DatabaseUsersGsmSecretRef {
    /// ProjectId identifies the project where the secret resource is.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "projectId")]
    pub project_id: Option<String>,
    /// SecretId identifies the secret.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretId")]
    pub secret_id: Option<String>,
    /// Version is the version of the secret. If "latest" is specified, underlying the latest SecretId is used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// A reference to a k8s secret.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct DatabaseUsersSecretRef {
    /// name is unique within a namespace to reference a secret resource.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// namespace defines the space within which the secret name must be unique.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// DatabaseStatus defines the observed state of Database.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct DatabaseStatus {
    /// UserResourceVersions is a map of username to user resource version (plaintext or GSM). For GSM Resource version, use format: "projects/{ProjectId}/secrets/{SecretId}/versions/{Version}".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "UserResourceVersions")]
    pub user_resource_versions: Option<BTreeMap<String, String>>,
    /// Conditions represents the latest available observations of the Database's current state.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<Condition>>,
    /// IsChangeApplied indicates whether database changes have been applied
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "isChangeApplied")]
    pub is_change_applied: Option<String>,
    /// ObservedGeneration is the latest generation observed by the controller.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")]
    pub observed_generation: Option<i64>,
    /// Phase is a summary of the current state of the Database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub phase: Option<String>,
    /// List of user names.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub usernames: Option<Vec<String>>,
}