Skip to main content

k8s_crds_cloud_native_pg/
databases.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium -f databases.yml --schema=derived --docs -b --derive=Default --derive=PartialEq --smart-derive-elision
3// kopium version: 0.24.1
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use kube_derive::CustomResource;
8    #[cfg(feature = "schemars")]
9    pub use schemars::JsonSchema;
10    pub use serde::{Deserialize, Serialize};
11    #[cfg(feature = "builder")]
12    pub use typed_builder::TypedBuilder;
13}
14
15use self::prelude::*;
16
17/// Specification of the desired Database.
18/// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
19#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
20#[cfg_attr(feature = "builder", derive(TypedBuilder))]
21#[cfg_attr(feature = "schemars", derive(JsonSchema))]
22#[cfg_attr(not(feature = "schemars"), kube(schema = "disabled"))]
23#[kube(
24    group = "postgresql.cnpg.io",
25    version = "v1",
26    kind = "Database",
27    plural = "databases"
28)]
29#[kube(namespaced)]
30#[kube(status = "DatabaseStatus")]
31#[kube(derive = "Default")]
32#[kube(derive = "PartialEq")]
33pub struct DatabaseSpec {
34    /// Maps to the `ALLOW_CONNECTIONS` parameter of `CREATE DATABASE` and
35    /// `ALTER DATABASE`. If false then no one can connect to this database.
36    #[serde(
37        default,
38        skip_serializing_if = "Option::is_none",
39        rename = "allowConnections"
40    )]
41    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
42    pub allow_connections: Option<bool>,
43    /// Maps to the `BUILTIN_LOCALE` parameter of `CREATE DATABASE`. This
44    /// setting cannot be changed. Specifies the locale name when the
45    /// builtin provider is used. This option requires `localeProvider` to
46    /// be set to `builtin`. Available from PostgreSQL 17.
47    #[serde(
48        default,
49        skip_serializing_if = "Option::is_none",
50        rename = "builtinLocale"
51    )]
52    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
53    pub builtin_locale: Option<String>,
54    /// The name of the PostgreSQL cluster hosting the database.
55    pub cluster: DatabaseCluster,
56    /// Maps to the `COLLATION_VERSION` parameter of `CREATE DATABASE`. This
57    /// setting cannot be changed.
58    #[serde(
59        default,
60        skip_serializing_if = "Option::is_none",
61        rename = "collationVersion"
62    )]
63    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
64    pub collation_version: Option<String>,
65    /// Maps to the `CONNECTION LIMIT` clause of `CREATE DATABASE` and
66    /// `ALTER DATABASE`. How many concurrent connections can be made to
67    /// this database. -1 (the default) means no limit.
68    #[serde(
69        default,
70        skip_serializing_if = "Option::is_none",
71        rename = "connectionLimit"
72    )]
73    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
74    pub connection_limit: Option<i64>,
75    /// The policy for end-of-life maintenance of this database.
76    #[serde(
77        default,
78        skip_serializing_if = "Option::is_none",
79        rename = "databaseReclaimPolicy"
80    )]
81    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
82    pub database_reclaim_policy: Option<DatabaseDatabaseReclaimPolicy>,
83    /// Maps to the `ENCODING` parameter of `CREATE DATABASE`. This setting
84    /// cannot be changed. Character set encoding to use in the database.
85    #[serde(default, skip_serializing_if = "Option::is_none")]
86    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
87    pub encoding: Option<String>,
88    /// Ensure the PostgreSQL database is `present` or `absent` - defaults to "present".
89    #[serde(default, skip_serializing_if = "Option::is_none")]
90    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
91    pub ensure: Option<DatabaseEnsure>,
92    /// The list of extensions to be managed in the database
93    #[serde(default, skip_serializing_if = "Option::is_none")]
94    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
95    pub extensions: Option<Vec<DatabaseExtensions>>,
96    /// The list of foreign data wrappers to be managed in the database
97    #[serde(default, skip_serializing_if = "Option::is_none")]
98    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
99    pub fdws: Option<Vec<DatabaseFdws>>,
100    /// Maps to the `ICU_LOCALE` parameter of `CREATE DATABASE`. This
101    /// setting cannot be changed. Specifies the ICU locale when the ICU
102    /// provider is used. This option requires `localeProvider` to be set to
103    /// `icu`. Available from PostgreSQL 15.
104    #[serde(default, skip_serializing_if = "Option::is_none", rename = "icuLocale")]
105    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
106    pub icu_locale: Option<String>,
107    /// Maps to the `ICU_RULES` parameter of `CREATE DATABASE`. This setting
108    /// cannot be changed. Specifies additional collation rules to customize
109    /// the behavior of the default collation. This option requires
110    /// `localeProvider` to be set to `icu`. Available from PostgreSQL 16.
111    #[serde(default, skip_serializing_if = "Option::is_none", rename = "icuRules")]
112    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
113    pub icu_rules: Option<String>,
114    /// Maps to the `IS_TEMPLATE` parameter of `CREATE DATABASE` and `ALTER
115    /// DATABASE`. If true, this database is considered a template and can
116    /// be cloned by any user with `CREATEDB` privileges.
117    #[serde(
118        default,
119        skip_serializing_if = "Option::is_none",
120        rename = "isTemplate"
121    )]
122    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
123    pub is_template: Option<bool>,
124    /// Maps to the `LOCALE` parameter of `CREATE DATABASE`. This setting
125    /// cannot be changed. Sets the default collation order and character
126    /// classification in the new database.
127    #[serde(default, skip_serializing_if = "Option::is_none")]
128    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
129    pub locale: Option<String>,
130    /// Maps to the `LC_CTYPE` parameter of `CREATE DATABASE`. This setting
131    /// cannot be changed.
132    #[serde(
133        default,
134        skip_serializing_if = "Option::is_none",
135        rename = "localeCType"
136    )]
137    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
138    pub locale_c_type: Option<String>,
139    /// Maps to the `LC_COLLATE` parameter of `CREATE DATABASE`. This
140    /// setting cannot be changed.
141    #[serde(
142        default,
143        skip_serializing_if = "Option::is_none",
144        rename = "localeCollate"
145    )]
146    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
147    pub locale_collate: Option<String>,
148    /// Maps to the `LOCALE_PROVIDER` parameter of `CREATE DATABASE`. This
149    /// setting cannot be changed. This option sets the locale provider for
150    /// databases created in the new cluster. Available from PostgreSQL 16.
151    #[serde(
152        default,
153        skip_serializing_if = "Option::is_none",
154        rename = "localeProvider"
155    )]
156    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
157    pub locale_provider: Option<String>,
158    /// The name of the database to create inside PostgreSQL. This setting cannot be changed.
159    pub name: String,
160    /// Maps to the `OWNER` parameter of `CREATE DATABASE`.
161    /// Maps to the `OWNER TO` command of `ALTER DATABASE`.
162    /// The role name of the user who owns the database inside PostgreSQL.
163    pub owner: String,
164    /// The list of schemas to be managed in the database
165    #[serde(default, skip_serializing_if = "Option::is_none")]
166    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
167    pub schemas: Option<Vec<DatabaseSchemas>>,
168    /// The list of foreign servers to be managed in the database
169    #[serde(default, skip_serializing_if = "Option::is_none")]
170    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
171    pub servers: Option<Vec<DatabaseServers>>,
172    /// Maps to the `TABLESPACE` parameter of `CREATE DATABASE`.
173    /// Maps to the `SET TABLESPACE` command of `ALTER DATABASE`.
174    /// The name of the tablespace (in PostgreSQL) that will be associated
175    /// with the new database. This tablespace will be the default
176    /// tablespace used for objects created in this database.
177    #[serde(default, skip_serializing_if = "Option::is_none")]
178    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
179    pub tablespace: Option<String>,
180    /// Maps to the `TEMPLATE` parameter of `CREATE DATABASE`. This setting
181    /// cannot be changed. The name of the template from which to create
182    /// this database.
183    #[serde(default, skip_serializing_if = "Option::is_none")]
184    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
185    pub template: Option<String>,
186}
187
188/// The name of the PostgreSQL cluster hosting the database.
189#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
190#[cfg_attr(feature = "builder", derive(TypedBuilder))]
191#[cfg_attr(feature = "schemars", derive(JsonSchema))]
192pub struct DatabaseCluster {
193    /// Name of the referent.
194    /// This field is effectively required, but due to backwards compatibility is
195    /// allowed to be empty. Instances of this type with an empty value here are
196    /// almost certainly wrong.
197    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
198    #[serde(default, skip_serializing_if = "Option::is_none")]
199    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
200    pub name: Option<String>,
201}
202
203/// Specification of the desired Database.
204/// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
205#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
206#[cfg_attr(feature = "schemars", derive(JsonSchema))]
207pub enum DatabaseDatabaseReclaimPolicy {
208    #[serde(rename = "delete")]
209    Delete,
210    #[serde(rename = "retain")]
211    Retain,
212}
213
214/// Specification of the desired Database.
215/// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
216#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
217#[cfg_attr(feature = "schemars", derive(JsonSchema))]
218pub enum DatabaseEnsure {
219    #[serde(rename = "present")]
220    Present,
221    #[serde(rename = "absent")]
222    Absent,
223}
224
225/// ExtensionSpec configures an extension in a database
226#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
227#[cfg_attr(feature = "builder", derive(TypedBuilder))]
228#[cfg_attr(feature = "schemars", derive(JsonSchema))]
229pub struct DatabaseExtensions {
230    /// Specifies whether an object (e.g schema) should be present or absent
231    /// in the database. If set to `present`, the object will be created if
232    /// it does not exist. If set to `absent`, the extension/schema will be
233    /// removed if it exists.
234    #[serde(default, skip_serializing_if = "Option::is_none")]
235    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
236    pub ensure: Option<DatabaseExtensionsEnsure>,
237    /// Name of the object (extension, schema, FDW, server)
238    pub name: String,
239    /// The name of the schema in which to install the extension's objects,
240    /// in case the extension allows its contents to be relocated. If not
241    /// specified (default), and the extension's control file does not
242    /// specify a schema either, the current default object creation schema
243    /// is used.
244    #[serde(default, skip_serializing_if = "Option::is_none")]
245    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
246    pub schema: Option<String>,
247    /// The version of the extension to install. If empty, the operator will
248    /// install the default version (whatever is specified in the
249    /// extension's control file)
250    #[serde(default, skip_serializing_if = "Option::is_none")]
251    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
252    pub version: Option<String>,
253}
254
255/// ExtensionSpec configures an extension in a database
256#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
257#[cfg_attr(feature = "schemars", derive(JsonSchema))]
258pub enum DatabaseExtensionsEnsure {
259    #[serde(rename = "present")]
260    Present,
261    #[serde(rename = "absent")]
262    Absent,
263}
264
265/// FDWSpec configures an Foreign Data Wrapper in a database
266#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
267#[cfg_attr(feature = "builder", derive(TypedBuilder))]
268#[cfg_attr(feature = "schemars", derive(JsonSchema))]
269pub struct DatabaseFdws {
270    /// Specifies whether an object (e.g schema) should be present or absent
271    /// in the database. If set to `present`, the object will be created if
272    /// it does not exist. If set to `absent`, the extension/schema will be
273    /// removed if it exists.
274    #[serde(default, skip_serializing_if = "Option::is_none")]
275    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
276    pub ensure: Option<DatabaseFdwsEnsure>,
277    /// Name of the handler function (e.g., "postgres_fdw_handler").
278    /// This will be empty if no handler is specified. In that case,
279    /// the default handler is registered when the FDW extension is created.
280    #[serde(default, skip_serializing_if = "Option::is_none")]
281    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
282    pub handler: Option<String>,
283    /// Name of the object (extension, schema, FDW, server)
284    pub name: String,
285    /// Options specifies the configuration options for the FDW.
286    #[serde(default, skip_serializing_if = "Option::is_none")]
287    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
288    pub options: Option<Vec<DatabaseFdwsOptions>>,
289    /// Owner specifies the database role that will own the Foreign Data Wrapper.
290    /// The role must have superuser privileges in the target database.
291    #[serde(default, skip_serializing_if = "Option::is_none")]
292    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
293    pub owner: Option<String>,
294    /// List of roles for which `USAGE` privileges on the FDW are granted or revoked.
295    #[serde(default, skip_serializing_if = "Option::is_none")]
296    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
297    pub usage: Option<Vec<DatabaseFdwsUsage>>,
298    /// Name of the validator function (e.g., "postgres_fdw_validator").
299    /// This will be empty if no validator is specified. In that case,
300    /// the default validator is registered when the FDW extension is created.
301    #[serde(default, skip_serializing_if = "Option::is_none")]
302    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
303    pub validator: Option<String>,
304}
305
306/// FDWSpec configures an Foreign Data Wrapper in a database
307#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
308#[cfg_attr(feature = "schemars", derive(JsonSchema))]
309pub enum DatabaseFdwsEnsure {
310    #[serde(rename = "present")]
311    Present,
312    #[serde(rename = "absent")]
313    Absent,
314}
315
316/// OptionSpec holds the name, value and the ensure field for an option
317#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
318#[cfg_attr(feature = "builder", derive(TypedBuilder))]
319#[cfg_attr(feature = "schemars", derive(JsonSchema))]
320pub struct DatabaseFdwsOptions {
321    /// Specifies whether an option should be present or absent in
322    /// the database. If set to `present`, the option will be
323    /// created if it does not exist. If set to `absent`, the
324    /// option will be removed if it exists.
325    #[serde(default, skip_serializing_if = "Option::is_none")]
326    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
327    pub ensure: Option<DatabaseFdwsOptionsEnsure>,
328    /// Name of the option
329    pub name: String,
330    /// Value of the option
331    pub value: String,
332}
333
334/// OptionSpec holds the name, value and the ensure field for an option
335#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
336#[cfg_attr(feature = "schemars", derive(JsonSchema))]
337pub enum DatabaseFdwsOptionsEnsure {
338    #[serde(rename = "present")]
339    Present,
340    #[serde(rename = "absent")]
341    Absent,
342}
343
344/// UsageSpec configures a usage for a foreign data wrapper
345#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
346#[cfg_attr(feature = "builder", derive(TypedBuilder))]
347#[cfg_attr(feature = "schemars", derive(JsonSchema))]
348pub struct DatabaseFdwsUsage {
349    /// Name of the usage
350    pub name: String,
351    /// The type of usage
352    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
353    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
354    pub r#type: Option<DatabaseFdwsUsageType>,
355}
356
357/// UsageSpec configures a usage for a foreign data wrapper
358#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
359#[cfg_attr(feature = "schemars", derive(JsonSchema))]
360pub enum DatabaseFdwsUsageType {
361    #[serde(rename = "grant")]
362    Grant,
363    #[serde(rename = "revoke")]
364    Revoke,
365}
366
367/// SchemaSpec configures a schema in a database
368#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
369#[cfg_attr(feature = "builder", derive(TypedBuilder))]
370#[cfg_attr(feature = "schemars", derive(JsonSchema))]
371pub struct DatabaseSchemas {
372    /// Specifies whether an object (e.g schema) should be present or absent
373    /// in the database. If set to `present`, the object will be created if
374    /// it does not exist. If set to `absent`, the extension/schema will be
375    /// removed if it exists.
376    #[serde(default, skip_serializing_if = "Option::is_none")]
377    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
378    pub ensure: Option<DatabaseSchemasEnsure>,
379    /// Name of the object (extension, schema, FDW, server)
380    pub name: String,
381    /// The role name of the user who owns the schema inside PostgreSQL.
382    /// It maps to the `AUTHORIZATION` parameter of `CREATE SCHEMA` and the
383    /// `OWNER TO` command of `ALTER SCHEMA`.
384    #[serde(default, skip_serializing_if = "Option::is_none")]
385    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
386    pub owner: Option<String>,
387}
388
389/// SchemaSpec configures a schema in a database
390#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
391#[cfg_attr(feature = "schemars", derive(JsonSchema))]
392pub enum DatabaseSchemasEnsure {
393    #[serde(rename = "present")]
394    Present,
395    #[serde(rename = "absent")]
396    Absent,
397}
398
399/// ServerSpec configures a server of a foreign data wrapper
400#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
401#[cfg_attr(feature = "builder", derive(TypedBuilder))]
402#[cfg_attr(feature = "schemars", derive(JsonSchema))]
403pub struct DatabaseServers {
404    /// Specifies whether an object (e.g schema) should be present or absent
405    /// in the database. If set to `present`, the object will be created if
406    /// it does not exist. If set to `absent`, the extension/schema will be
407    /// removed if it exists.
408    #[serde(default, skip_serializing_if = "Option::is_none")]
409    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
410    pub ensure: Option<DatabaseServersEnsure>,
411    /// The name of the Foreign Data Wrapper (FDW)
412    pub fdw: String,
413    /// Name of the object (extension, schema, FDW, server)
414    pub name: String,
415    /// Options specifies the configuration options for the server
416    /// (key is the option name, value is the option value).
417    #[serde(default, skip_serializing_if = "Option::is_none")]
418    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
419    pub options: Option<Vec<DatabaseServersOptions>>,
420    /// List of roles for which `USAGE` privileges on the server are granted or revoked.
421    #[serde(default, skip_serializing_if = "Option::is_none")]
422    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
423    pub usage: Option<Vec<DatabaseServersUsage>>,
424}
425
426/// ServerSpec configures a server of a foreign data wrapper
427#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
428#[cfg_attr(feature = "schemars", derive(JsonSchema))]
429pub enum DatabaseServersEnsure {
430    #[serde(rename = "present")]
431    Present,
432    #[serde(rename = "absent")]
433    Absent,
434}
435
436/// OptionSpec holds the name, value and the ensure field for an option
437#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
438#[cfg_attr(feature = "builder", derive(TypedBuilder))]
439#[cfg_attr(feature = "schemars", derive(JsonSchema))]
440pub struct DatabaseServersOptions {
441    /// Specifies whether an option should be present or absent in
442    /// the database. If set to `present`, the option will be
443    /// created if it does not exist. If set to `absent`, the
444    /// option will be removed if it exists.
445    #[serde(default, skip_serializing_if = "Option::is_none")]
446    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
447    pub ensure: Option<DatabaseServersOptionsEnsure>,
448    /// Name of the option
449    pub name: String,
450    /// Value of the option
451    pub value: String,
452}
453
454/// OptionSpec holds the name, value and the ensure field for an option
455#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
456#[cfg_attr(feature = "schemars", derive(JsonSchema))]
457pub enum DatabaseServersOptionsEnsure {
458    #[serde(rename = "present")]
459    Present,
460    #[serde(rename = "absent")]
461    Absent,
462}
463
464/// UsageSpec configures a usage for a foreign data wrapper
465#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
466#[cfg_attr(feature = "builder", derive(TypedBuilder))]
467#[cfg_attr(feature = "schemars", derive(JsonSchema))]
468pub struct DatabaseServersUsage {
469    /// Name of the usage
470    pub name: String,
471    /// The type of usage
472    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
473    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
474    pub r#type: Option<DatabaseServersUsageType>,
475}
476
477/// UsageSpec configures a usage for a foreign data wrapper
478#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
479#[cfg_attr(feature = "schemars", derive(JsonSchema))]
480pub enum DatabaseServersUsageType {
481    #[serde(rename = "grant")]
482    Grant,
483    #[serde(rename = "revoke")]
484    Revoke,
485}
486
487/// Most recently observed status of the Database. This data may not be up to
488/// date. Populated by the system. Read-only.
489/// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
490#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
491#[cfg_attr(feature = "builder", derive(TypedBuilder))]
492#[cfg_attr(feature = "schemars", derive(JsonSchema))]
493pub struct DatabaseStatus {
494    /// Applied is true if the database was reconciled correctly
495    #[serde(default, skip_serializing_if = "Option::is_none")]
496    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
497    pub applied: Option<bool>,
498    /// Extensions is the status of the managed extensions
499    #[serde(default, skip_serializing_if = "Option::is_none")]
500    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
501    pub extensions: Option<Vec<DatabaseStatusExtensions>>,
502    /// FDWs is the status of the managed FDWs
503    #[serde(default, skip_serializing_if = "Option::is_none")]
504    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
505    pub fdws: Option<Vec<DatabaseStatusFdws>>,
506    /// Message is the reconciliation output message
507    #[serde(default, skip_serializing_if = "Option::is_none")]
508    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
509    pub message: Option<String>,
510    /// A sequence number representing the latest
511    /// desired state that was synchronized
512    #[serde(
513        default,
514        skip_serializing_if = "Option::is_none",
515        rename = "observedGeneration"
516    )]
517    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
518    pub observed_generation: Option<i64>,
519    /// Schemas is the status of the managed schemas
520    #[serde(default, skip_serializing_if = "Option::is_none")]
521    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
522    pub schemas: Option<Vec<DatabaseStatusSchemas>>,
523    /// Servers is the status of the managed servers
524    #[serde(default, skip_serializing_if = "Option::is_none")]
525    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
526    pub servers: Option<Vec<DatabaseStatusServers>>,
527}
528
529/// DatabaseObjectStatus is the status of the managed database objects
530#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
531#[cfg_attr(feature = "builder", derive(TypedBuilder))]
532#[cfg_attr(feature = "schemars", derive(JsonSchema))]
533pub struct DatabaseStatusExtensions {
534    /// True of the object has been installed successfully in
535    /// the database
536    pub applied: bool,
537    /// Message is the object reconciliation message
538    #[serde(default, skip_serializing_if = "Option::is_none")]
539    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
540    pub message: Option<String>,
541    /// The name of the object
542    pub name: String,
543}
544
545/// DatabaseObjectStatus is the status of the managed database objects
546#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
547#[cfg_attr(feature = "builder", derive(TypedBuilder))]
548#[cfg_attr(feature = "schemars", derive(JsonSchema))]
549pub struct DatabaseStatusFdws {
550    /// True of the object has been installed successfully in
551    /// the database
552    pub applied: bool,
553    /// Message is the object reconciliation message
554    #[serde(default, skip_serializing_if = "Option::is_none")]
555    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
556    pub message: Option<String>,
557    /// The name of the object
558    pub name: String,
559}
560
561/// DatabaseObjectStatus is the status of the managed database objects
562#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
563#[cfg_attr(feature = "builder", derive(TypedBuilder))]
564#[cfg_attr(feature = "schemars", derive(JsonSchema))]
565pub struct DatabaseStatusSchemas {
566    /// True of the object has been installed successfully in
567    /// the database
568    pub applied: bool,
569    /// Message is the object reconciliation message
570    #[serde(default, skip_serializing_if = "Option::is_none")]
571    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
572    pub message: Option<String>,
573    /// The name of the object
574    pub name: String,
575}
576
577/// DatabaseObjectStatus is the status of the managed database objects
578#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
579#[cfg_attr(feature = "builder", derive(TypedBuilder))]
580#[cfg_attr(feature = "schemars", derive(JsonSchema))]
581pub struct DatabaseStatusServers {
582    /// True of the object has been installed successfully in
583    /// the database
584    pub applied: bool,
585    /// Message is the object reconciliation message
586    #[serde(default, skip_serializing_if = "Option::is_none")]
587    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
588    pub message: Option<String>,
589    /// The name of the object
590    pub name: String,
591}