@@ -3561,6 +3561,89 @@ export const ApiApiFetchParamCreator = function (
3561
3561
options : localVarRequestOptions ,
3562
3562
} ;
3563
3563
} ,
3564
+ /**
3565
+ * @summary Forks an existing collection.
3566
+ * @param {string } tenant <p>Tenant ID</p>
3567
+ * @param {string } database <p>Database name</p>
3568
+ * @param {string } collectionId <p>UUID of the collection to update</p>
3569
+ * @param {Api.ForkCollectionPayload } request
3570
+ * @param {RequestInit } [options] Override http request option.
3571
+ * @throws {RequiredError }
3572
+ */
3573
+ forkCollection (
3574
+ tenant : string ,
3575
+ database : string ,
3576
+ collectionId : string ,
3577
+ request : Api . ForkCollectionPayload ,
3578
+ options : RequestInit = { } ,
3579
+ ) : FetchArgs {
3580
+ // verify required parameter 'tenant' is not null or undefined
3581
+ if ( tenant === null || tenant === undefined ) {
3582
+ throw new RequiredError (
3583
+ "tenant" ,
3584
+ "Required parameter tenant was null or undefined when calling forkCollection." ,
3585
+ ) ;
3586
+ }
3587
+ // verify required parameter 'database' is not null or undefined
3588
+ if ( database === null || database === undefined ) {
3589
+ throw new RequiredError (
3590
+ "database" ,
3591
+ "Required parameter database was null or undefined when calling forkCollection." ,
3592
+ ) ;
3593
+ }
3594
+ // verify required parameter 'collectionId' is not null or undefined
3595
+ if ( collectionId === null || collectionId === undefined ) {
3596
+ throw new RequiredError (
3597
+ "collectionId" ,
3598
+ "Required parameter collectionId was null or undefined when calling forkCollection." ,
3599
+ ) ;
3600
+ }
3601
+ // verify required parameter 'request' is not null or undefined
3602
+ if ( request === null || request === undefined ) {
3603
+ throw new RequiredError (
3604
+ "request" ,
3605
+ "Required parameter request was null or undefined when calling forkCollection." ,
3606
+ ) ;
3607
+ }
3608
+ let localVarPath =
3609
+ `/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/fork`
3610
+ . replace ( "{tenant}" , encodeURIComponent ( String ( tenant ) ) )
3611
+ . replace ( "{database}" , encodeURIComponent ( String ( database ) ) )
3612
+ . replace ( "{collection_id}" , encodeURIComponent ( String ( collectionId ) ) ) ;
3613
+ const localVarPathQueryStart = localVarPath . indexOf ( "?" ) ;
3614
+ const localVarRequestOptions : RequestInit = Object . assign (
3615
+ { method : "POST" } ,
3616
+ options ,
3617
+ ) ;
3618
+ const localVarHeaderParameter : Headers = options . headers
3619
+ ? new Headers ( options . headers )
3620
+ : new Headers ( ) ;
3621
+ const localVarQueryParameter = new URLSearchParams (
3622
+ localVarPathQueryStart !== - 1
3623
+ ? localVarPath . substring ( localVarPathQueryStart + 1 )
3624
+ : "" ,
3625
+ ) ;
3626
+ if ( localVarPathQueryStart !== - 1 ) {
3627
+ localVarPath = localVarPath . substring ( 0 , localVarPathQueryStart ) ;
3628
+ }
3629
+
3630
+ localVarHeaderParameter . set ( "Content-Type" , "application/json" ) ;
3631
+
3632
+ localVarRequestOptions . headers = localVarHeaderParameter ;
3633
+
3634
+ if ( request !== undefined ) {
3635
+ localVarRequestOptions . body = JSON . stringify ( request || { } ) ;
3636
+ }
3637
+
3638
+ const localVarQueryParameterString = localVarQueryParameter . toString ( ) ;
3639
+ if ( localVarQueryParameterString ) {
3640
+ localVarPath += "?" + localVarQueryParameterString ;
3641
+ }
3642
+ return {
3643
+ url : localVarPath ,
3644
+ options : localVarRequestOptions ,
3645
+ } ;
3646
+ } ,
3564
3647
/**
3565
3648
* @summary Retrieves a collection by ID or name.
3566
3649
* @param {string } tenant <p>Tenant ID</p>
@@ -6631,6 +6714,63 @@ export const ApiApiFp = function (configuration?: Configuration) {
6631
6714
} ) ;
6632
6715
} ;
6633
6716
} ,
6717
+ /**
6718
+ * @summary Forks an existing collection.
6719
+ * @param {string } tenant <p>Tenant ID</p>
6720
+ * @param {string } database <p>Database name</p>
6721
+ * @param {string } collectionId <p>UUID of the collection to update</p>
6722
+ * @param {Api.ForkCollectionPayload } request
6723
+ * @param {RequestInit } [options] Override http request option.
6724
+ * @throws {RequiredError }
6725
+ */
6726
+ forkCollection (
6727
+ tenant : string ,
6728
+ database : string ,
6729
+ collectionId : string ,
6730
+ request : Api . ForkCollectionPayload ,
6731
+ options ?: RequestInit ,
6732
+ ) : ( fetch ?: FetchAPI , basePath ?: string ) => Promise < Api . Collection > {
6733
+ const localVarFetchArgs = ApiApiFetchParamCreator (
6734
+ configuration ,
6735
+ ) . forkCollection ( tenant , database , collectionId , request , options ) ;
6736
+ return ( fetch : FetchAPI = defaultFetch , basePath : string = BASE_PATH ) => {
6737
+ return fetch (
6738
+ basePath + localVarFetchArgs . url ,
6739
+ localVarFetchArgs . options ,
6740
+ ) . then ( ( response ) => {
6741
+ const contentType = response . headers . get ( "Content-Type" ) ;
6742
+ const mimeType = contentType
6743
+ ? contentType . replace ( / ; .* / , "" )
6744
+ : undefined ;
6745
+
6746
+ if ( response . status === 200 ) {
6747
+ if ( mimeType === "application/json" ) {
6748
+ return response . json ( ) as any ;
6749
+ }
6750
+ throw response ;
6751
+ }
6752
+ if ( response . status === 401 ) {
6753
+ if ( mimeType === "application/json" ) {
6754
+ throw response ;
6755
+ }
6756
+ throw response ;
6757
+ }
6758
+ if ( response . status === 404 ) {
6759
+ if ( mimeType === "application/json" ) {
6760
+ throw response ;
6761
+ }
6762
+ throw response ;
6763
+ }
6764
+ if ( response . status === 500 ) {
6765
+ if ( mimeType === "application/json" ) {
6766
+ throw response ;
6767
+ }
6768
+ throw response ;
6769
+ }
6770
+ throw response ;
6771
+ } ) ;
6772
+ } ;
6773
+ } ,
6634
6774
/**
6635
6775
* @summary Retrieves a collection by ID or name.
6636
6776
* @param {string } tenant <p>Tenant ID</p>
@@ -8258,6 +8398,31 @@ export class ApiApi extends BaseAPI {
8258
8398
) ( this . fetch , this . basePath ) ;
8259
8399
}
8260
8400
8401
+ /**
8402
+ * @summary Forks an existing collection.
8403
+ * @param {string } tenant <p>Tenant ID</p>
8404
+ * @param {string } database <p>Database name</p>
8405
+ * @param {string } collectionId <p>UUID of the collection to update</p>
8406
+ * @param {Api.ForkCollectionPayload } request
8407
+ * @param {RequestInit } [options] Override http request option.
8408
+ * @throws {RequiredError }
8409
+ */
8410
+ public forkCollection (
8411
+ tenant : string ,
8412
+ database : string ,
8413
+ collectionId : string ,
8414
+ request : Api . ForkCollectionPayload ,
8415
+ options ?: RequestInit ,
8416
+ ) {
8417
+ return ApiApiFp ( this . configuration ) . forkCollection (
8418
+ tenant ,
8419
+ database ,
8420
+ collectionId ,
8421
+ request ,
8422
+ options ,
8423
+ ) ( this . fetch , this . basePath ) ;
8424
+ }
8425
+
8261
8426
/**
8262
8427
* @summary Retrieves a collection by ID or name.
8263
8428
* @param {string } tenant <p>Tenant ID</p>
0 commit comments