@@ -1486,6 +1486,89 @@ export const ApiApiFetchParamCreator = function (
1486
1486
options : localVarRequestOptions ,
1487
1487
} ;
1488
1488
} ,
1489
+ /**
1490
+ * @summary Forks an existing collection.
1491
+ * @param {string } tenant <p>Tenant ID</p>
1492
+ * @param {string } database <p>Database name</p>
1493
+ * @param {string } collectionId <p>UUID of the collection to update</p>
1494
+ * @param {Api.ForkCollectionPayload } request
1495
+ * @param {RequestInit } [options] Override http request option.
1496
+ * @throws {RequiredError }
1497
+ */
1498
+ forkCollection (
1499
+ tenant : string ,
1500
+ database : string ,
1501
+ collectionId : string ,
1502
+ request : Api . ForkCollectionPayload ,
1503
+ options : RequestInit = { } ,
1504
+ ) : FetchArgs {
1505
+ // verify required parameter 'tenant' is not null or undefined
1506
+ if ( tenant === null || tenant === undefined ) {
1507
+ throw new RequiredError (
1508
+ "tenant" ,
1509
+ "Required parameter tenant was null or undefined when calling forkCollection." ,
1510
+ ) ;
1511
+ }
1512
+ // verify required parameter 'database' is not null or undefined
1513
+ if ( database === null || database === undefined ) {
1514
+ throw new RequiredError (
1515
+ "database" ,
1516
+ "Required parameter database was null or undefined when calling forkCollection." ,
1517
+ ) ;
1518
+ }
1519
+ // verify required parameter 'collectionId' is not null or undefined
1520
+ if ( collectionId === null || collectionId === undefined ) {
1521
+ throw new RequiredError (
1522
+ "collectionId" ,
1523
+ "Required parameter collectionId was null or undefined when calling forkCollection." ,
1524
+ ) ;
1525
+ }
1526
+ // verify required parameter 'request' is not null or undefined
1527
+ if ( request === null || request === undefined ) {
1528
+ throw new RequiredError (
1529
+ "request" ,
1530
+ "Required parameter request was null or undefined when calling forkCollection." ,
1531
+ ) ;
1532
+ }
1533
+ let localVarPath =
1534
+ `/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/fork`
1535
+ . replace ( "{tenant}" , encodeURIComponent ( String ( tenant ) ) )
1536
+ . replace ( "{database}" , encodeURIComponent ( String ( database ) ) )
1537
+ . replace ( "{collection_id}" , encodeURIComponent ( String ( collectionId ) ) ) ;
1538
+ const localVarPathQueryStart = localVarPath . indexOf ( "?" ) ;
1539
+ const localVarRequestOptions : RequestInit = Object . assign (
1540
+ { method : "POST" } ,
1541
+ options ,
1542
+ ) ;
1543
+ const localVarHeaderParameter : Headers = options . headers
1544
+ ? new Headers ( options . headers )
1545
+ : new Headers ( ) ;
1546
+ const localVarQueryParameter = new URLSearchParams (
1547
+ localVarPathQueryStart !== - 1
1548
+ ? localVarPath . substring ( localVarPathQueryStart + 1 )
1549
+ : "" ,
1550
+ ) ;
1551
+ if ( localVarPathQueryStart !== - 1 ) {
1552
+ localVarPath = localVarPath . substring ( 0 , localVarPathQueryStart ) ;
1553
+ }
1554
+
1555
+ localVarHeaderParameter . set ( "Content-Type" , "application/json" ) ;
1556
+
1557
+ localVarRequestOptions . headers = localVarHeaderParameter ;
1558
+
1559
+ if ( request !== undefined ) {
1560
+ localVarRequestOptions . body = JSON . stringify ( request || { } ) ;
1561
+ }
1562
+
1563
+ const localVarQueryParameterString = localVarQueryParameter . toString ( ) ;
1564
+ if ( localVarQueryParameterString ) {
1565
+ localVarPath += "?" + localVarQueryParameterString ;
1566
+ }
1567
+ return {
1568
+ url : localVarPath ,
1569
+ options : localVarRequestOptions ,
1570
+ } ;
1571
+ } ,
1489
1572
/**
1490
1573
* @summary Retrieves a collection by ID or name.
1491
1574
* @param {string } tenant <p>Tenant ID</p>
@@ -3131,6 +3214,63 @@ export const ApiApiFp = function (configuration?: Configuration) {
3131
3214
} ) ;
3132
3215
} ;
3133
3216
} ,
3217
+ /**
3218
+ * @summary Forks an existing collection.
3219
+ * @param {string } tenant <p>Tenant ID</p>
3220
+ * @param {string } database <p>Database name</p>
3221
+ * @param {string } collectionId <p>UUID of the collection to update</p>
3222
+ * @param {Api.ForkCollectionPayload } request
3223
+ * @param {RequestInit } [options] Override http request option.
3224
+ * @throws {RequiredError }
3225
+ */
3226
+ forkCollection (
3227
+ tenant : string ,
3228
+ database : string ,
3229
+ collectionId : string ,
3230
+ request : Api . ForkCollectionPayload ,
3231
+ options ?: RequestInit ,
3232
+ ) : ( fetch ?: FetchAPI , basePath ?: string ) => Promise < Api . Collection > {
3233
+ const localVarFetchArgs = ApiApiFetchParamCreator (
3234
+ configuration ,
3235
+ ) . forkCollection ( tenant , database , collectionId , request , options ) ;
3236
+ return ( fetch : FetchAPI = defaultFetch , basePath : string = BASE_PATH ) => {
3237
+ return fetch (
3238
+ basePath + localVarFetchArgs . url ,
3239
+ localVarFetchArgs . options ,
3240
+ ) . then ( ( response ) => {
3241
+ const contentType = response . headers . get ( "Content-Type" ) ;
3242
+ const mimeType = contentType
3243
+ ? contentType . replace ( / ; .* / , "" )
3244
+ : undefined ;
3245
+
3246
+ if ( response . status === 200 ) {
3247
+ if ( mimeType === "application/json" ) {
3248
+ return response . json ( ) as any ;
3249
+ }
3250
+ throw response ;
3251
+ }
3252
+ if ( response . status === 401 ) {
3253
+ if ( mimeType === "application/json" ) {
3254
+ throw response ;
3255
+ }
3256
+ throw response ;
3257
+ }
3258
+ if ( response . status === 404 ) {
3259
+ if ( mimeType === "application/json" ) {
3260
+ throw response ;
3261
+ }
3262
+ throw response ;
3263
+ }
3264
+ if ( response . status === 500 ) {
3265
+ if ( mimeType === "application/json" ) {
3266
+ throw response ;
3267
+ }
3268
+ throw response ;
3269
+ }
3270
+ throw response ;
3271
+ } ) ;
3272
+ } ;
3273
+ } ,
3134
3274
/**
3135
3275
* @summary Retrieves a collection by ID or name.
3136
3276
* @param {string } tenant <p>Tenant ID</p>
@@ -4133,6 +4273,31 @@ export class ApiApi extends BaseAPI {
4133
4273
) ( this . fetch , this . basePath ) ;
4134
4274
}
4135
4275
4276
+ /**
4277
+ * @summary Forks an existing collection.
4278
+ * @param {string } tenant <p>Tenant ID</p>
4279
+ * @param {string } database <p>Database name</p>
4280
+ * @param {string } collectionId <p>UUID of the collection to update</p>
4281
+ * @param {Api.ForkCollectionPayload } request
4282
+ * @param {RequestInit } [options] Override http request option.
4283
+ * @throws {RequiredError }
4284
+ */
4285
+ public forkCollection (
4286
+ tenant : string ,
4287
+ database : string ,
4288
+ collectionId : string ,
4289
+ request : Api . ForkCollectionPayload ,
4290
+ options ?: RequestInit ,
4291
+ ) {
4292
+ return ApiApiFp ( this . configuration ) . forkCollection (
4293
+ tenant ,
4294
+ database ,
4295
+ collectionId ,
4296
+ request ,
4297
+ options ,
4298
+ ) ( this . fetch , this . basePath ) ;
4299
+ }
4300
+
4136
4301
/**
4137
4302
* @summary Retrieves a collection by ID or name.
4138
4303
* @param {string } tenant <p>Tenant ID</p>
0 commit comments