@@ -2731,6 +2731,89 @@ export const ApiApiFetchParamCreator = function (
2731
2731
options : localVarRequestOptions ,
2732
2732
} ;
2733
2733
} ,
2734
+ /**
2735
+ * @summary Forks an existing collection.
2736
+ * @param {string } tenant <p>Tenant ID</p>
2737
+ * @param {string } database <p>Database name</p>
2738
+ * @param {string } collectionId <p>UUID of the collection to update</p>
2739
+ * @param {Api.ForkCollectionPayload } request
2740
+ * @param {RequestInit } [options] Override http request option.
2741
+ * @throws {RequiredError }
2742
+ */
2743
+ forkCollection (
2744
+ tenant : string ,
2745
+ database : string ,
2746
+ collectionId : string ,
2747
+ request : Api . ForkCollectionPayload ,
2748
+ options : RequestInit = { } ,
2749
+ ) : FetchArgs {
2750
+ // verify required parameter 'tenant' is not null or undefined
2751
+ if ( tenant === null || tenant === undefined ) {
2752
+ throw new RequiredError (
2753
+ "tenant" ,
2754
+ "Required parameter tenant was null or undefined when calling forkCollection." ,
2755
+ ) ;
2756
+ }
2757
+ // verify required parameter 'database' is not null or undefined
2758
+ if ( database === null || database === undefined ) {
2759
+ throw new RequiredError (
2760
+ "database" ,
2761
+ "Required parameter database was null or undefined when calling forkCollection." ,
2762
+ ) ;
2763
+ }
2764
+ // verify required parameter 'collectionId' is not null or undefined
2765
+ if ( collectionId === null || collectionId === undefined ) {
2766
+ throw new RequiredError (
2767
+ "collectionId" ,
2768
+ "Required parameter collectionId was null or undefined when calling forkCollection." ,
2769
+ ) ;
2770
+ }
2771
+ // verify required parameter 'request' is not null or undefined
2772
+ if ( request === null || request === undefined ) {
2773
+ throw new RequiredError (
2774
+ "request" ,
2775
+ "Required parameter request was null or undefined when calling forkCollection." ,
2776
+ ) ;
2777
+ }
2778
+ let localVarPath =
2779
+ `/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/fork`
2780
+ . replace ( "{tenant}" , encodeURIComponent ( String ( tenant ) ) )
2781
+ . replace ( "{database}" , encodeURIComponent ( String ( database ) ) )
2782
+ . replace ( "{collection_id}" , encodeURIComponent ( String ( collectionId ) ) ) ;
2783
+ const localVarPathQueryStart = localVarPath . indexOf ( "?" ) ;
2784
+ const localVarRequestOptions : RequestInit = Object . assign (
2785
+ { method : "POST" } ,
2786
+ options ,
2787
+ ) ;
2788
+ const localVarHeaderParameter : Headers = options . headers
2789
+ ? new Headers ( options . headers )
2790
+ : new Headers ( ) ;
2791
+ const localVarQueryParameter = new URLSearchParams (
2792
+ localVarPathQueryStart !== - 1
2793
+ ? localVarPath . substring ( localVarPathQueryStart + 1 )
2794
+ : "" ,
2795
+ ) ;
2796
+ if ( localVarPathQueryStart !== - 1 ) {
2797
+ localVarPath = localVarPath . substring ( 0 , localVarPathQueryStart ) ;
2798
+ }
2799
+
2800
+ localVarHeaderParameter . set ( "Content-Type" , "application/json" ) ;
2801
+
2802
+ localVarRequestOptions . headers = localVarHeaderParameter ;
2803
+
2804
+ if ( request !== undefined ) {
2805
+ localVarRequestOptions . body = JSON . stringify ( request || { } ) ;
2806
+ }
2807
+
2808
+ const localVarQueryParameterString = localVarQueryParameter . toString ( ) ;
2809
+ if ( localVarQueryParameterString ) {
2810
+ localVarPath += "?" + localVarQueryParameterString ;
2811
+ }
2812
+ return {
2813
+ url : localVarPath ,
2814
+ options : localVarRequestOptions ,
2815
+ } ;
2816
+ } ,
2734
2817
/**
2735
2818
* @summary Retrieves a collection by ID or name.
2736
2819
* @param {string } tenant <p>Tenant ID</p>
@@ -5231,6 +5314,63 @@ export const ApiApiFp = function (configuration?: Configuration) {
5231
5314
} ) ;
5232
5315
} ;
5233
5316
} ,
5317
+ /**
5318
+ * @summary Forks an existing collection.
5319
+ * @param {string } tenant <p>Tenant ID</p>
5320
+ * @param {string } database <p>Database name</p>
5321
+ * @param {string } collectionId <p>UUID of the collection to update</p>
5322
+ * @param {Api.ForkCollectionPayload } request
5323
+ * @param {RequestInit } [options] Override http request option.
5324
+ * @throws {RequiredError }
5325
+ */
5326
+ forkCollection (
5327
+ tenant : string ,
5328
+ database : string ,
5329
+ collectionId : string ,
5330
+ request : Api . ForkCollectionPayload ,
5331
+ options ?: RequestInit ,
5332
+ ) : ( fetch ?: FetchAPI , basePath ?: string ) => Promise < Api . Collection > {
5333
+ const localVarFetchArgs = ApiApiFetchParamCreator (
5334
+ configuration ,
5335
+ ) . forkCollection ( tenant , database , collectionId , request , options ) ;
5336
+ return ( fetch : FetchAPI = defaultFetch , basePath : string = BASE_PATH ) => {
5337
+ return fetch (
5338
+ basePath + localVarFetchArgs . url ,
5339
+ localVarFetchArgs . options ,
5340
+ ) . then ( ( response ) => {
5341
+ const contentType = response . headers . get ( "Content-Type" ) ;
5342
+ const mimeType = contentType
5343
+ ? contentType . replace ( / ; .* / , "" )
5344
+ : undefined ;
5345
+
5346
+ if ( response . status === 200 ) {
5347
+ if ( mimeType === "application/json" ) {
5348
+ return response . json ( ) as any ;
5349
+ }
5350
+ throw response ;
5351
+ }
5352
+ if ( response . status === 401 ) {
5353
+ if ( mimeType === "application/json" ) {
5354
+ throw response ;
5355
+ }
5356
+ throw response ;
5357
+ }
5358
+ if ( response . status === 404 ) {
5359
+ if ( mimeType === "application/json" ) {
5360
+ throw response ;
5361
+ }
5362
+ throw response ;
5363
+ }
5364
+ if ( response . status === 500 ) {
5365
+ if ( mimeType === "application/json" ) {
5366
+ throw response ;
5367
+ }
5368
+ throw response ;
5369
+ }
5370
+ throw response ;
5371
+ } ) ;
5372
+ } ;
5373
+ } ,
5234
5374
/**
5235
5375
* @summary Retrieves a collection by ID or name.
5236
5376
* @param {string } tenant <p>Tenant ID</p>
@@ -6608,6 +6748,31 @@ export class ApiApi extends BaseAPI {
6608
6748
) ( this . fetch , this . basePath ) ;
6609
6749
}
6610
6750
6751
+ /**
6752
+ * @summary Forks an existing collection.
6753
+ * @param {string } tenant <p>Tenant ID</p>
6754
+ * @param {string } database <p>Database name</p>
6755
+ * @param {string } collectionId <p>UUID of the collection to update</p>
6756
+ * @param {Api.ForkCollectionPayload } request
6757
+ * @param {RequestInit } [options] Override http request option.
6758
+ * @throws {RequiredError }
6759
+ */
6760
+ public forkCollection (
6761
+ tenant : string ,
6762
+ database : string ,
6763
+ collectionId : string ,
6764
+ request : Api . ForkCollectionPayload ,
6765
+ options ?: RequestInit ,
6766
+ ) {
6767
+ return ApiApiFp ( this . configuration ) . forkCollection (
6768
+ tenant ,
6769
+ database ,
6770
+ collectionId ,
6771
+ request ,
6772
+ options ,
6773
+ ) ( this . fetch , this . basePath ) ;
6774
+ }
6775
+
6611
6776
/**
6612
6777
* @summary Retrieves a collection by ID or name.
6613
6778
* @param {string } tenant <p>Tenant ID</p>
0 commit comments