tembo_api_client/models/extension.rs
1/*
2 * Tembo Cloud
3 *
4 * Platform API for Tembo Cloud </br> </br> To find a Tembo Data API, please find it here: </br> </br> [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/)
5 *
6 * The version of the OpenAPI document: v1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Extension : Extension lets you define a list of extensions to enable on the instance. To enable extensions, you must specify the name of the extension and the database, schema, and version to enable it on. If the version is not specified, the latest version will be used. The extension must also be installed on the instance. To install extensions, please refer to the `TrunkInstall` resource. This example will enable the pg_stat_statements extension on the Postgres database in the public schema. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: extensions: - name: pg_stat_statements locations: - database: postgres enabled: true schema: public version: 1.10.0 ````
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Extension {
17 /// A description of the extension. (Optional) **Default**: \"No description provided\"
18 #[serde(
19 rename = "description",
20 default,
21 with = "::serde_with::rust::double_option",
22 skip_serializing_if = "Option::is_none"
23 )]
24 pub description: Option<Option<String>>,
25 /// A list of locations (databases) to enabled the extension on.
26 #[serde(rename = "locations")]
27 pub locations: Vec<models::ExtensionInstallLocation>,
28 /// The name of the extension to enable.
29 #[serde(rename = "name")]
30 pub name: String,
31}
32
33impl Extension {
34 /// Extension lets you define a list of extensions to enable on the instance. To enable extensions, you must specify the name of the extension and the database, schema, and version to enable it on. If the version is not specified, the latest version will be used. The extension must also be installed on the instance. To install extensions, please refer to the `TrunkInstall` resource. This example will enable the pg_stat_statements extension on the Postgres database in the public schema. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: extensions: - name: pg_stat_statements locations: - database: postgres enabled: true schema: public version: 1.10.0 ````
35 pub fn new(locations: Vec<models::ExtensionInstallLocation>, name: String) -> Extension {
36 Extension {
37 description: None,
38 locations,
39 name,
40 }
41 }
42}