pinecone_sdk/openapi/models/
serverless_spec.rs

1/*
2 * Pinecone Control Plane API
3 *
4 * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
5 *
6 * The version of the OpenAPI document: 2024-07
7 * Contact: support@pinecone.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::openapi::models;
12use serde::{Deserialize, Serialize};
13
14/// ServerlessSpec : Configuration needed to deploy a serverless index.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ServerlessSpec {
17    /// The public cloud where you would like your index hosted.
18    #[serde(rename = "cloud")]
19    pub cloud: Cloud,
20    /// The region where you would like your index to be created. 
21    #[serde(rename = "region")]
22    pub region: String,
23}
24
25impl ServerlessSpec {
26    /// Configuration needed to deploy a serverless index.
27    pub fn new(cloud: Cloud, region: String) -> ServerlessSpec {
28        ServerlessSpec {
29            cloud,
30            region,
31        }
32    }
33}
34/// The public cloud where you would like your index hosted.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Cloud {
37    #[serde(rename = "gcp")]
38    Gcp,
39    #[serde(rename = "aws")]
40    Aws,
41    #[serde(rename = "azure")]
42    Azure,
43}
44
45impl Default for Cloud {
46    fn default() -> Cloud {
47        Self::Gcp
48    }
49}
50