pinecone_sdk/openapi/models/
create_collection_request.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/// CreateCollectionRequest : The configuration needed to create a Pinecone collection.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateCollectionRequest {
17    /// The name of the collection to be created. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. 
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The name of the index to be used as the source for the collection.
21    #[serde(rename = "source")]
22    pub source: String,
23}
24
25impl CreateCollectionRequest {
26    /// The configuration needed to create a Pinecone collection.
27    pub fn new(name: String, source: String) -> CreateCollectionRequest {
28        CreateCollectionRequest {
29            name,
30            source,
31        }
32    }
33}
34