// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium -f databases.yml --schema=derived --docs -b --derive=Default --derive=PartialEq --smart-derive-elision
// kopium version: 0.21.2

#[allow(unused_imports)]
mod prelude {
    pub use kube_derive::CustomResource;
    #[cfg(feature = "schemars")]
    pub use schemars::JsonSchema;
    pub use serde::{Deserialize, Serialize};
    #[cfg(feature = "builder")]
    pub use typed_builder::TypedBuilder;
}
use self::prelude::*;

/// Specification of the desired Database.
/// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[cfg_attr(not(feature = "schemars"), kube(schema = "disabled"))]
#[kube(
    group = "postgresql.cnpg.io",
    version = "v1",
    kind = "Database",
    plural = "databases"
)]
#[kube(namespaced)]
#[kube(status = "DatabaseStatus")]
#[kube(derive = "Default")]
#[kube(derive = "PartialEq")]
pub struct DatabaseSpec {
    /// Maps to the `ALLOW_CONNECTIONS` parameter of `CREATE DATABASE` and
    /// `ALTER DATABASE`. If false then no one can connect to this database.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "allowConnections"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub allow_connections: Option<bool>,
    /// Maps to the `BUILTIN_LOCALE` parameter of `CREATE DATABASE`. This
    /// setting cannot be changed. Specifies the locale name when the
    /// builtin provider is used. This option requires `localeProvider` to
    /// be set to `builtin`. Available from PostgreSQL 17.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "builtinLocale"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub builtin_locale: Option<String>,
    /// The name of the PostgreSQL cluster hosting the database.
    pub cluster: DatabaseCluster,
    /// Maps to the `COLLATION_VERSION` parameter of `CREATE DATABASE`. This
    /// setting cannot be changed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "collationVersion"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub collation_version: Option<String>,
    /// Maps to the `CONNECTION LIMIT` clause of `CREATE DATABASE` and
    /// `ALTER DATABASE`. How many concurrent connections can be made to
    /// this database. -1 (the default) means no limit.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "connectionLimit"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub connection_limit: Option<i64>,
    /// The policy for end-of-life maintenance of this database.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "databaseReclaimPolicy"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub database_reclaim_policy: Option<DatabaseDatabaseReclaimPolicy>,
    /// Maps to the `ENCODING` parameter of `CREATE DATABASE`. This setting
    /// cannot be changed. Character set encoding to use in the database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub encoding: Option<String>,
    /// Ensure the PostgreSQL database is `present` or `absent` - defaults to "present".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ensure: Option<DatabaseEnsure>,
    /// The list of extensions to be managed in the database
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub extensions: Option<Vec<DatabaseExtensions>>,
    /// The list of foreign data wrappers to be managed in the database
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub fdws: Option<Vec<DatabaseFdws>>,
    /// Maps to the `ICU_LOCALE` parameter of `CREATE DATABASE`. This
    /// setting cannot be changed. Specifies the ICU locale when the ICU
    /// provider is used. This option requires `localeProvider` to be set to
    /// `icu`. Available from PostgreSQL 15.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "icuLocale")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub icu_locale: Option<String>,
    /// Maps to the `ICU_RULES` parameter of `CREATE DATABASE`. This setting
    /// cannot be changed. Specifies additional collation rules to customize
    /// the behavior of the default collation. This option requires
    /// `localeProvider` to be set to `icu`. Available from PostgreSQL 16.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "icuRules")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub icu_rules: Option<String>,
    /// Maps to the `IS_TEMPLATE` parameter of `CREATE DATABASE` and `ALTER
    /// DATABASE`. If true, this database is considered a template and can
    /// be cloned by any user with `CREATEDB` privileges.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "isTemplate"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub is_template: Option<bool>,
    /// Maps to the `LOCALE` parameter of `CREATE DATABASE`. This setting
    /// cannot be changed. Sets the default collation order and character
    /// classification in the new database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub locale: Option<String>,
    /// Maps to the `LC_CTYPE` parameter of `CREATE DATABASE`. This setting
    /// cannot be changed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "localeCType"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub locale_c_type: Option<String>,
    /// Maps to the `LC_COLLATE` parameter of `CREATE DATABASE`. This
    /// setting cannot be changed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "localeCollate"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub locale_collate: Option<String>,
    /// Maps to the `LOCALE_PROVIDER` parameter of `CREATE DATABASE`. This
    /// setting cannot be changed. This option sets the locale provider for
    /// databases created in the new cluster. Available from PostgreSQL 16.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "localeProvider"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub locale_provider: Option<String>,
    /// The name of the database to create inside PostgreSQL. This setting cannot be changed.
    pub name: String,
    /// Maps to the `OWNER` parameter of `CREATE DATABASE`.
    /// Maps to the `OWNER TO` command of `ALTER DATABASE`.
    /// The role name of the user who owns the database inside PostgreSQL.
    pub owner: String,
    /// The list of schemas to be managed in the database
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub schemas: Option<Vec<DatabaseSchemas>>,
    /// The list of foreign servers to be managed in the database
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub servers: Option<Vec<DatabaseServers>>,
    /// Maps to the `TABLESPACE` parameter of `CREATE DATABASE`.
    /// Maps to the `SET TABLESPACE` command of `ALTER DATABASE`.
    /// The name of the tablespace (in PostgreSQL) that will be associated
    /// with the new database. This tablespace will be the default
    /// tablespace used for objects created in this database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub tablespace: Option<String>,
    /// Maps to the `TEMPLATE` parameter of `CREATE DATABASE`. This setting
    /// cannot be changed. The name of the template from which to create
    /// this database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub template: Option<String>,
}

/// The name of the PostgreSQL cluster hosting the database.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseCluster {
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub name: Option<String>,
}

/// Specification of the desired Database.
/// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseDatabaseReclaimPolicy {
    #[serde(rename = "delete")]
    Delete,
    #[serde(rename = "retain")]
    Retain,
}

/// Specification of the desired Database.
/// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseEnsure {
    #[serde(rename = "present")]
    Present,
    #[serde(rename = "absent")]
    Absent,
}

/// ExtensionSpec configures an extension in a database
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseExtensions {
    /// Specifies whether an object (e.g schema) should be present or absent
    /// in the database. If set to `present`, the object will be created if
    /// it does not exist. If set to `absent`, the extension/schema will be
    /// removed if it exists.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ensure: Option<DatabaseExtensionsEnsure>,
    /// Name of the object (extension, schema, FDW, server)
    pub name: String,
    /// The name of the schema in which to install the extension's objects,
    /// in case the extension allows its contents to be relocated. If not
    /// specified (default), and the extension's control file does not
    /// specify a schema either, the current default object creation schema
    /// is used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub schema: Option<String>,
    /// The version of the extension to install. If empty, the operator will
    /// install the default version (whatever is specified in the
    /// extension's control file)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub version: Option<String>,
}

/// ExtensionSpec configures an extension in a database
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseExtensionsEnsure {
    #[serde(rename = "present")]
    Present,
    #[serde(rename = "absent")]
    Absent,
}

/// FDWSpec configures an Foreign Data Wrapper in a database
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseFdws {
    /// Specifies whether an object (e.g schema) should be present or absent
    /// in the database. If set to `present`, the object will be created if
    /// it does not exist. If set to `absent`, the extension/schema will be
    /// removed if it exists.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ensure: Option<DatabaseFdwsEnsure>,
    /// Name of the handler function (e.g., "postgres_fdw_handler").
    /// This will be empty if no handler is specified. In that case,
    /// the default handler is registered when the FDW extension is created.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub handler: Option<String>,
    /// Name of the object (extension, schema, FDW, server)
    pub name: String,
    /// Options specifies the configuration options for the FDW.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub options: Option<Vec<DatabaseFdwsOptions>>,
    /// Owner specifies the database role that will own the Foreign Data Wrapper.
    /// The role must have superuser privileges in the target database.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub owner: Option<String>,
    /// List of roles for which `USAGE` privileges on the FDW are granted or revoked.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub usage: Option<Vec<DatabaseFdwsUsage>>,
    /// Name of the validator function (e.g., "postgres_fdw_validator").
    /// This will be empty if no validator is specified. In that case,
    /// the default validator is registered when the FDW extension is created.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub validator: Option<String>,
}

/// FDWSpec configures an Foreign Data Wrapper in a database
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseFdwsEnsure {
    #[serde(rename = "present")]
    Present,
    #[serde(rename = "absent")]
    Absent,
}

/// OptionSpec holds the name, value and the ensure field for an option
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseFdwsOptions {
    /// Specifies whether an option should be present or absent in
    /// the database. If set to `present`, the option will be
    /// created if it does not exist. If set to `absent`, the
    /// option will be removed if it exists.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ensure: Option<DatabaseFdwsOptionsEnsure>,
    /// Name of the option
    pub name: String,
    /// Value of the option
    pub value: String,
}

/// OptionSpec holds the name, value and the ensure field for an option
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseFdwsOptionsEnsure {
    #[serde(rename = "present")]
    Present,
    #[serde(rename = "absent")]
    Absent,
}

/// UsageSpec configures a usage for a foreign data wrapper
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseFdwsUsage {
    /// Name of the usage
    pub name: String,
    /// The type of usage
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub r#type: Option<DatabaseFdwsUsageType>,
}

/// UsageSpec configures a usage for a foreign data wrapper
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseFdwsUsageType {
    #[serde(rename = "grant")]
    Grant,
    #[serde(rename = "revoke")]
    Revoke,
}

/// SchemaSpec configures a schema in a database
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseSchemas {
    /// Specifies whether an object (e.g schema) should be present or absent
    /// in the database. If set to `present`, the object will be created if
    /// it does not exist. If set to `absent`, the extension/schema will be
    /// removed if it exists.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ensure: Option<DatabaseSchemasEnsure>,
    /// Name of the object (extension, schema, FDW, server)
    pub name: String,
    /// The role name of the user who owns the schema inside PostgreSQL.
    /// It maps to the `AUTHORIZATION` parameter of `CREATE SCHEMA` and the
    /// `OWNER TO` command of `ALTER SCHEMA`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub owner: Option<String>,
}

/// SchemaSpec configures a schema in a database
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseSchemasEnsure {
    #[serde(rename = "present")]
    Present,
    #[serde(rename = "absent")]
    Absent,
}

/// ServerSpec configures a server of a foreign data wrapper
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseServers {
    /// Specifies whether an object (e.g schema) should be present or absent
    /// in the database. If set to `present`, the object will be created if
    /// it does not exist. If set to `absent`, the extension/schema will be
    /// removed if it exists.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ensure: Option<DatabaseServersEnsure>,
    /// The name of the Foreign Data Wrapper (FDW)
    pub fdw: String,
    /// Name of the object (extension, schema, FDW, server)
    pub name: String,
    /// Options specifies the configuration options for the server
    /// (key is the option name, value is the option value).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub options: Option<Vec<DatabaseServersOptions>>,
    /// List of roles for which `USAGE` privileges on the server are granted or revoked.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub usage: Option<Vec<DatabaseServersUsage>>,
}

/// ServerSpec configures a server of a foreign data wrapper
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseServersEnsure {
    #[serde(rename = "present")]
    Present,
    #[serde(rename = "absent")]
    Absent,
}

/// OptionSpec holds the name, value and the ensure field for an option
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseServersOptions {
    /// Specifies whether an option should be present or absent in
    /// the database. If set to `present`, the option will be
    /// created if it does not exist. If set to `absent`, the
    /// option will be removed if it exists.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ensure: Option<DatabaseServersOptionsEnsure>,
    /// Name of the option
    pub name: String,
    /// Value of the option
    pub value: String,
}

/// OptionSpec holds the name, value and the ensure field for an option
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseServersOptionsEnsure {
    #[serde(rename = "present")]
    Present,
    #[serde(rename = "absent")]
    Absent,
}

/// UsageSpec configures a usage for a foreign data wrapper
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseServersUsage {
    /// Name of the usage
    pub name: String,
    /// The type of usage
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub r#type: Option<DatabaseServersUsageType>,
}

/// UsageSpec configures a usage for a foreign data wrapper
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum DatabaseServersUsageType {
    #[serde(rename = "grant")]
    Grant,
    #[serde(rename = "revoke")]
    Revoke,
}

/// Most recently observed status of the Database. This data may not be up to
/// date. Populated by the system. Read-only.
/// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseStatus {
    /// Applied is true if the database was reconciled correctly
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub applied: Option<bool>,
    /// Extensions is the status of the managed extensions
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub extensions: Option<Vec<DatabaseStatusExtensions>>,
    /// FDWs is the status of the managed FDWs
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub fdws: Option<Vec<DatabaseStatusFdws>>,
    /// Message is the reconciliation output message
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub message: Option<String>,
    /// A sequence number representing the latest
    /// desired state that was synchronized
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "observedGeneration"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub observed_generation: Option<i64>,
    /// Schemas is the status of the managed schemas
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub schemas: Option<Vec<DatabaseStatusSchemas>>,
    /// Servers is the status of the managed servers
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub servers: Option<Vec<DatabaseStatusServers>>,
}

/// DatabaseObjectStatus is the status of the managed database objects
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseStatusExtensions {
    /// True of the object has been installed successfully in
    /// the database
    pub applied: bool,
    /// Message is the object reconciliation message
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub message: Option<String>,
    /// The name of the object
    pub name: String,
}

/// DatabaseObjectStatus is the status of the managed database objects
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseStatusFdws {
    /// True of the object has been installed successfully in
    /// the database
    pub applied: bool,
    /// Message is the object reconciliation message
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub message: Option<String>,
    /// The name of the object
    pub name: String,
}

/// DatabaseObjectStatus is the status of the managed database objects
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseStatusSchemas {
    /// True of the object has been installed successfully in
    /// the database
    pub applied: bool,
    /// Message is the object reconciliation message
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub message: Option<String>,
    /// The name of the object
    pub name: String,
}

/// DatabaseObjectStatus is the status of the managed database objects
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct DatabaseStatusServers {
    /// True of the object has been installed successfully in
    /// the database
    pub applied: bool,
    /// Message is the object reconciliation message
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub message: Option<String>,
    /// The name of the object
    pub name: String,
}
