@@ -411,6 +411,56 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory {
411411 return requestContext ;
412412 }
413413
414+ /**
415+ * Document move to folder
416+ * @param id Specify document ID.
417+ * @param folderId Specify folder ID.
418+ */
419+ public async documentMoveToFolder ( id : string , folderId : string , _options ?: Configuration ) : Promise < RequestContext > {
420+ let _config = _options || this . configuration ;
421+
422+ // verify required parameter 'id' is not null or undefined
423+ if ( id === null || id === undefined ) {
424+ throw new RequiredError ( "DocumentsApi" , "documentMoveToFolder" , "id" ) ;
425+ }
426+
427+
428+ // verify required parameter 'folderId' is not null or undefined
429+ if ( folderId === null || folderId === undefined ) {
430+ throw new RequiredError ( "DocumentsApi" , "documentMoveToFolder" , "folderId" ) ;
431+ }
432+
433+
434+ // Path Params
435+ const localVarPath = '/public/v1/documents/{id}/move-to-folder/{folder_id}'
436+ . replace ( '{' + 'id' + '}' , encodeURIComponent ( String ( id ) ) )
437+ . replace ( '{' + 'folder_id' + '}' , encodeURIComponent ( String ( folderId ) ) ) ;
438+
439+ // Make Request Context
440+ const requestContext = _config . baseServer . makeRequestContext ( localVarPath , HttpMethod . DELETE ) ;
441+ requestContext . setHeaderParam ( "Accept" , "application/json, */*;q=0.8" )
442+
443+
444+ let authMethod : SecurityAuthentication | undefined ;
445+ // Apply auth methods
446+ authMethod = _config . authMethods [ "apiKey" ]
447+ if ( authMethod ?. applySecurityAuthentication ) {
448+ await authMethod ?. applySecurityAuthentication ( requestContext ) ;
449+ }
450+ // Apply auth methods
451+ authMethod = _config . authMethods [ "oauth2" ]
452+ if ( authMethod ?. applySecurityAuthentication ) {
453+ await authMethod ?. applySecurityAuthentication ( requestContext ) ;
454+ }
455+
456+ const defaultAuth : SecurityAuthentication | undefined = _options ?. authMethods ?. default || this . configuration ?. authMethods ?. default
457+ if ( defaultAuth ?. applySecurityAuthentication ) {
458+ await defaultAuth ?. applySecurityAuthentication ( requestContext ) ;
459+ }
460+
461+ return requestContext ;
462+ }
463+
414464 /**
415465 * Document download
416466 * @param id Specify document ID.
@@ -1433,6 +1483,59 @@ export class DocumentsApiResponseProcessor {
14331483 throw new ApiException < string | Buffer | undefined > ( response . httpStatusCode , "Unknown API Status Code!" , await response . getBodyAsAny ( ) , response . headers ) ;
14341484 }
14351485
1486+ /**
1487+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
1488+ * to the expected objects
1489+ *
1490+ * @params response Response returned by the server for a request to documentMoveToFolder
1491+ * @throws ApiException if the response code was not in [200, 299]
1492+ */
1493+ public async documentMoveToFolder ( response : ResponseContext ) : Promise < void > {
1494+ const contentType = ObjectSerializer . normalizeMediaType ( response . headers [ "content-type" ] ) ;
1495+ if ( isCodeInRange ( "204" , response . httpStatusCode ) ) {
1496+ return ;
1497+ }
1498+ if ( isCodeInRange ( "401" , response . httpStatusCode ) ) {
1499+ const body : any = ObjectSerializer . deserialize (
1500+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
1501+ "any" , ""
1502+ ) as any ;
1503+ throw new ApiException < any > ( 401 , "Authentication error" , body , response . headers ) ;
1504+ }
1505+ if ( isCodeInRange ( "403" , response . httpStatusCode ) ) {
1506+ const body : any = ObjectSerializer . deserialize (
1507+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
1508+ "any" , ""
1509+ ) as any ;
1510+ throw new ApiException < any > ( 403 , "Permission error" , body , response . headers ) ;
1511+ }
1512+ if ( isCodeInRange ( "404" , response . httpStatusCode ) ) {
1513+ const body : any = ObjectSerializer . deserialize (
1514+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
1515+ "any" , ""
1516+ ) as any ;
1517+ throw new ApiException < any > ( 404 , "Not found" , body , response . headers ) ;
1518+ }
1519+ if ( isCodeInRange ( "429" , response . httpStatusCode ) ) {
1520+ const body : any = ObjectSerializer . deserialize (
1521+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
1522+ "any" , ""
1523+ ) as any ;
1524+ throw new ApiException < any > ( 429 , "Too Many Requests" , body , response . headers ) ;
1525+ }
1526+
1527+ // Work around for missing responses in specification, e.g. for petstore.yaml
1528+ if ( response . httpStatusCode >= 200 && response . httpStatusCode <= 299 ) {
1529+ const body : void = ObjectSerializer . deserialize (
1530+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
1531+ "void" , ""
1532+ ) as void ;
1533+ return body ;
1534+ }
1535+
1536+ throw new ApiException < string | Buffer | undefined > ( response . httpStatusCode , "Unknown API Status Code!" , await response . getBodyAsAny ( ) , response . headers ) ;
1537+ }
1538+
14361539 /**
14371540 * Unwraps the actual response sent by the server from the response context and deserializes the response content
14381541 * to the expected objects
0 commit comments