@@ -328,7 +328,7 @@ impl PineconeClient {
328
328
///
329
329
/// ### Arguments
330
330
/// * name: &str - The name of the index to be configured.
331
- /// * deletion_protection: DeletionProtection - Deletion protection for the index.
331
+ /// * deletion_protection: Option< DeletionProtection> - Deletion protection for the index.
332
332
/// * replicas: Option<i32> - The desired number of replicas, lowest value is 0. This parameter should be `None` if the index is serverless.
333
333
/// * pod_type: Option<&str> - The new pod_type for the index. This parameter should be `None` if the index is serverless.
334
334
///
@@ -346,14 +346,14 @@ impl PineconeClient {
346
346
/// let pinecone = PineconeClient::new(None, None, None, None).unwrap();
347
347
///
348
348
/// // Configure an index in the project.
349
- /// let response = pinecone.configure_index("index-name", DeletionProtection::Enabled, Some(6), Some("s1.x1")).await;
349
+ /// let response = pinecone.configure_index("index-name", Some( DeletionProtection::Enabled) , Some(6), Some("s1.x1")).await;
350
350
/// # Ok(())
351
351
/// # }
352
352
/// ```
353
353
pub async fn configure_index (
354
354
& self ,
355
355
name : & str ,
356
- deletion_protection : DeletionProtection ,
356
+ deletion_protection : Option < DeletionProtection > ,
357
357
replicas : Option < i32 > ,
358
358
pod_type : Option < & str > ,
359
359
) -> Result < IndexModel , PineconeError > {
@@ -369,7 +369,7 @@ impl PineconeClient {
369
369
370
370
let configure_index_request = ConfigureIndexRequest {
371
371
spec,
372
- deletion_protection : Some ( deletion_protection ) ,
372
+ deletion_protection,
373
373
} ;
374
374
375
375
// make openAPI call
@@ -1605,7 +1605,7 @@ mod tests {
1605
1605
let configure_index_response = pinecone
1606
1606
. configure_index (
1607
1607
"index-name" ,
1608
- DeletionProtection :: Disabled ,
1608
+ Some ( DeletionProtection :: Disabled ) ,
1609
1609
Some ( 6 ) ,
1610
1610
Some ( "p1.x1" ) ,
1611
1611
)
@@ -1671,7 +1671,7 @@ mod tests {
1671
1671
. expect ( "Failed to create Pinecone instance" ) ;
1672
1672
1673
1673
let configure_index_response = pinecone
1674
- . configure_index ( "index-name" , DeletionProtection :: Disabled , None , None )
1674
+ . configure_index ( "index-name" , Some ( DeletionProtection :: Disabled ) , None , None )
1675
1675
. await
1676
1676
. expect ( "Failed to configure index" ) ;
1677
1677
@@ -1717,7 +1717,7 @@ mod tests {
1717
1717
let configure_index_response = pinecone
1718
1718
. configure_index (
1719
1719
"index-name" ,
1720
- DeletionProtection :: Enabled ,
1720
+ Some ( DeletionProtection :: Enabled ) ,
1721
1721
Some ( 6 ) ,
1722
1722
Some ( "p1.x1" ) ,
1723
1723
)
@@ -1764,7 +1764,7 @@ mod tests {
1764
1764
let configure_index_response = pinecone
1765
1765
. configure_index (
1766
1766
"index-name" ,
1767
- DeletionProtection :: Disabled ,
1767
+ Some ( DeletionProtection :: Disabled ) ,
1768
1768
Some ( 6 ) ,
1769
1769
Some ( "p1.x1" ) ,
1770
1770
)
@@ -1811,7 +1811,7 @@ mod tests {
1811
1811
let configure_index_response = pinecone
1812
1812
. configure_index (
1813
1813
"index-name" ,
1814
- DeletionProtection :: Enabled ,
1814
+ Some ( DeletionProtection :: Enabled ) ,
1815
1815
Some ( 6 ) ,
1816
1816
Some ( "p1.x1" ) ,
1817
1817
)
@@ -1848,7 +1848,7 @@ mod tests {
1848
1848
let configure_index_response = pinecone
1849
1849
. configure_index (
1850
1850
"index-name" ,
1851
- DeletionProtection :: Enabled ,
1851
+ Some ( DeletionProtection :: Enabled ) ,
1852
1852
Some ( 6 ) ,
1853
1853
Some ( "p1.x1" ) ,
1854
1854
)
0 commit comments