@@ -4308,6 +4308,89 @@ export const ApiApiFetchParamCreator = function (
4308
4308
options : localVarRequestOptions ,
4309
4309
} ;
4310
4310
} ,
4311
+ /**
4312
+ * @summary Forks an existing collection.
4313
+ * @param {string } tenant <p>Tenant ID</p>
4314
+ * @param {string } database <p>Database name</p>
4315
+ * @param {string } collectionId <p>UUID of the collection to update</p>
4316
+ * @param {Api.ForkCollectionPayload } request
4317
+ * @param {RequestInit } [options] Override http request option.
4318
+ * @throws {RequiredError }
4319
+ */
4320
+ forkCollection (
4321
+ tenant : string ,
4322
+ database : string ,
4323
+ collectionId : string ,
4324
+ request : Api . ForkCollectionPayload ,
4325
+ options : RequestInit = { } ,
4326
+ ) : FetchArgs {
4327
+ // verify required parameter 'tenant' is not null or undefined
4328
+ if ( tenant === null || tenant === undefined ) {
4329
+ throw new RequiredError (
4330
+ "tenant" ,
4331
+ "Required parameter tenant was null or undefined when calling forkCollection." ,
4332
+ ) ;
4333
+ }
4334
+ // verify required parameter 'database' is not null or undefined
4335
+ if ( database === null || database === undefined ) {
4336
+ throw new RequiredError (
4337
+ "database" ,
4338
+ "Required parameter database was null or undefined when calling forkCollection." ,
4339
+ ) ;
4340
+ }
4341
+ // verify required parameter 'collectionId' is not null or undefined
4342
+ if ( collectionId === null || collectionId === undefined ) {
4343
+ throw new RequiredError (
4344
+ "collectionId" ,
4345
+ "Required parameter collectionId was null or undefined when calling forkCollection." ,
4346
+ ) ;
4347
+ }
4348
+ // verify required parameter 'request' is not null or undefined
4349
+ if ( request === null || request === undefined ) {
4350
+ throw new RequiredError (
4351
+ "request" ,
4352
+ "Required parameter request was null or undefined when calling forkCollection." ,
4353
+ ) ;
4354
+ }
4355
+ let localVarPath =
4356
+ `/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/fork`
4357
+ . replace ( "{tenant}" , encodeURIComponent ( String ( tenant ) ) )
4358
+ . replace ( "{database}" , encodeURIComponent ( String ( database ) ) )
4359
+ . replace ( "{collection_id}" , encodeURIComponent ( String ( collectionId ) ) ) ;
4360
+ const localVarPathQueryStart = localVarPath . indexOf ( "?" ) ;
4361
+ const localVarRequestOptions : RequestInit = Object . assign (
4362
+ { method : "POST" } ,
4363
+ options ,
4364
+ ) ;
4365
+ const localVarHeaderParameter : Headers = options . headers
4366
+ ? new Headers ( options . headers )
4367
+ : new Headers ( ) ;
4368
+ const localVarQueryParameter = new URLSearchParams (
4369
+ localVarPathQueryStart !== - 1
4370
+ ? localVarPath . substring ( localVarPathQueryStart + 1 )
4371
+ : "" ,
4372
+ ) ;
4373
+ if ( localVarPathQueryStart !== - 1 ) {
4374
+ localVarPath = localVarPath . substring ( 0 , localVarPathQueryStart ) ;
4375
+ }
4376
+
4377
+ localVarHeaderParameter . set ( "Content-Type" , "application/json" ) ;
4378
+
4379
+ localVarRequestOptions . headers = localVarHeaderParameter ;
4380
+
4381
+ if ( request !== undefined ) {
4382
+ localVarRequestOptions . body = JSON . stringify ( request || { } ) ;
4383
+ }
4384
+
4385
+ const localVarQueryParameterString = localVarQueryParameter . toString ( ) ;
4386
+ if ( localVarQueryParameterString ) {
4387
+ localVarPath += "?" + localVarQueryParameterString ;
4388
+ }
4389
+ return {
4390
+ url : localVarPath ,
4391
+ options : localVarRequestOptions ,
4392
+ } ;
4393
+ } ,
4311
4394
/**
4312
4395
* @summary Retrieves a collection by ID or name.
4313
4396
* @param {string } tenant <p>Tenant ID</p>
@@ -7891,6 +7974,63 @@ export const ApiApiFp = function (configuration?: Configuration) {
7891
7974
} ) ;
7892
7975
} ;
7893
7976
} ,
7977
+ /**
7978
+ * @summary Forks an existing collection.
7979
+ * @param {string } tenant <p>Tenant ID</p>
7980
+ * @param {string } database <p>Database name</p>
7981
+ * @param {string } collectionId <p>UUID of the collection to update</p>
7982
+ * @param {Api.ForkCollectionPayload } request
7983
+ * @param {RequestInit } [options] Override http request option.
7984
+ * @throws {RequiredError }
7985
+ */
7986
+ forkCollection (
7987
+ tenant : string ,
7988
+ database : string ,
7989
+ collectionId : string ,
7990
+ request : Api . ForkCollectionPayload ,
7991
+ options ?: RequestInit ,
7992
+ ) : ( fetch ?: FetchAPI , basePath ?: string ) => Promise < Api . Collection > {
7993
+ const localVarFetchArgs = ApiApiFetchParamCreator (
7994
+ configuration ,
7995
+ ) . forkCollection ( tenant , database , collectionId , request , options ) ;
7996
+ return ( fetch : FetchAPI = defaultFetch , basePath : string = BASE_PATH ) => {
7997
+ return fetch (
7998
+ basePath + localVarFetchArgs . url ,
7999
+ localVarFetchArgs . options ,
8000
+ ) . then ( ( response ) => {
8001
+ const contentType = response . headers . get ( "Content-Type" ) ;
8002
+ const mimeType = contentType
8003
+ ? contentType . replace ( / ; .* / , "" )
8004
+ : undefined ;
8005
+
8006
+ if ( response . status === 200 ) {
8007
+ if ( mimeType === "application/json" ) {
8008
+ return response . json ( ) as any ;
8009
+ }
8010
+ throw response ;
8011
+ }
8012
+ if ( response . status === 401 ) {
8013
+ if ( mimeType === "application/json" ) {
8014
+ throw response ;
8015
+ }
8016
+ throw response ;
8017
+ }
8018
+ if ( response . status === 404 ) {
8019
+ if ( mimeType === "application/json" ) {
8020
+ throw response ;
8021
+ }
8022
+ throw response ;
8023
+ }
8024
+ if ( response . status === 500 ) {
8025
+ if ( mimeType === "application/json" ) {
8026
+ throw response ;
8027
+ }
8028
+ throw response ;
8029
+ }
8030
+ throw response ;
8031
+ } ) ;
8032
+ } ;
8033
+ } ,
7894
8034
/**
7895
8035
* @summary Retrieves a collection by ID or name.
7896
8036
* @param {string } tenant <p>Tenant ID</p>
@@ -9743,6 +9883,31 @@ export class ApiApi extends BaseAPI {
9743
9883
) ( this . fetch , this . basePath ) ;
9744
9884
}
9745
9885
9886
+ /**
9887
+ * @summary Forks an existing collection.
9888
+ * @param {string } tenant <p>Tenant ID</p>
9889
+ * @param {string } database <p>Database name</p>
9890
+ * @param {string } collectionId <p>UUID of the collection to update</p>
9891
+ * @param {Api.ForkCollectionPayload } request
9892
+ * @param {RequestInit } [options] Override http request option.
9893
+ * @throws {RequiredError }
9894
+ */
9895
+ public forkCollection (
9896
+ tenant : string ,
9897
+ database : string ,
9898
+ collectionId : string ,
9899
+ request : Api . ForkCollectionPayload ,
9900
+ options ?: RequestInit ,
9901
+ ) {
9902
+ return ApiApiFp ( this . configuration ) . forkCollection (
9903
+ tenant ,
9904
+ database ,
9905
+ collectionId ,
9906
+ request ,
9907
+ options ,
9908
+ ) ( this . fetch , this . basePath ) ;
9909
+ }
9910
+
9746
9911
/**
9747
9912
* @summary Retrieves a collection by ID or name.
9748
9913
* @param {string } tenant <p>Tenant ID</p>
0 commit comments