# LogicalDocRestApi.FolderApi

All URIs are relative to *https://localhost:8080/services/rest*

Method | HTTP request | Description
------------- | ------------- | -------------
[**copy**](FolderApi.md#copy) | **POST** /folder/copy | Copies a folder
[**createAliasFolder**](FolderApi.md#createAliasFolder) | **POST** /folder/createAlias | Creates a new folder alias
[**createFolder**](FolderApi.md#createFolder) | **POST** /folder/createFolder | Creates a subfolder
[**createFolderByModel**](FolderApi.md#createFolderByModel) | **POST** /folder/create | Creates a new folder
[**createPath**](FolderApi.md#createPath) | **POST** /folder/createPath | Creates a path
[**createSimple**](FolderApi.md#createSimple) | **POST** /folder/createSimple | Creates folders from path
[**createSimpleForm**](FolderApi.md#createSimpleForm) | **POST** /folder/createSimpleForm | Creates folders from path
[**createSimpleJSON**](FolderApi.md#createSimpleJSON) | **POST** /folder/createSimpleJSON | Creates folders from path
[**deleteFolder**](FolderApi.md#deleteFolder) | **DELETE** /folder/delete | Deletes a folder
[**findByPath**](FolderApi.md#findByPath) | **GET** /folder/findByPath | Gets a folder
[**getDefaultWorkspace**](FolderApi.md#getDefaultWorkspace) | **GET** /folder/getDefaultWorkspace | Gets the Default workspace
[**getFolder**](FolderApi.md#getFolder) | **GET** /folder/getFolder | Gets a folder
[**getGrantedGroups**](FolderApi.md#getGrantedGroups) | **GET** /folder/getGrantedGroups | Retrieves the list of granted groups for the given folder
[**getGrantedUsers**](FolderApi.md#getGrantedUsers) | **GET** /folder/getGrantedUsers | Retrieves the list of granted users for the given folder
[**getPath**](FolderApi.md#getPath) | **GET** /folder/getPath | Gets a path of folders
[**getPathString**](FolderApi.md#getPathString) | **GET** /folder/getPathString | Gets a path
[**getRootFolder**](FolderApi.md#getRootFolder) | **GET** /folder/getRootFolder | Gets the root folder
[**grantGroup**](FolderApi.md#grantGroup) | **PUT** /folder/grantGroup | Grants group permission to the folder
[**grantUser**](FolderApi.md#grantUser) | **PUT** /folder/grantUser | Grants user permission to the folder
[**isGranted**](FolderApi.md#isGranted) | **GET** /folder/isGranted | Tests user permission on a folder
[**isReadableFolder**](FolderApi.md#isReadableFolder) | **GET** /folder/isReadable | Tests if a folder is readable
[**isWritable**](FolderApi.md#isWritable) | **GET** /folder/isWritable | Tests if a folder is writable
[**listChildren**](FolderApi.md#listChildren) | **GET** /folder/listChildren | Lists the child folders
[**listWorkspaces**](FolderApi.md#listWorkspaces) | **GET** /folder/listWorkspaces | Retrieves the list of all workspaces
[**moveFolder**](FolderApi.md#moveFolder) | **PUT** /folder/move | Moves a folder
[**renameFolder**](FolderApi.md#renameFolder) | **PUT** /folder/rename | Renames a folder
[**updateFolder**](FolderApi.md#updateFolder) | **POST** /folder/update | Updates a folder


<a name="copy"></a>
# **copy**
> copy(folderId, targetId, foldersOnly, inheritSecurity)

Copies a folder

Copies an existing folder (source) into the given target; it can copy all the documents contained while defining the inheritance of security policies

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | Folder identifier (source)

var targetId = 789; // Number | The folder ID of the target folder

var foldersOnly = 56; // Number | If 1, only the folders will be copied and not the documents

var inheritSecurity = 56; // Number | If 1, the new folders will inherit the target's security policies


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.copy(folderId, targetId, foldersOnly, inheritSecurity, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| Folder identifier (source) | 
 **targetId** | **Number**| The folder ID of the target folder | 
 **foldersOnly** | **Number**| If 1, only the folders will be copied and not the documents | 
 **inheritSecurity** | **Number**| If 1, the new folders will inherit the target's security policies | 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="createAliasFolder"></a>
# **createAliasFolder**
> WSFolder createAliasFolder(opts)

Creates a new folder alias

Creates a new alias/simlink of the source folder into the target folder; returns the newly created alias

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'parentId': 789, // Number | Folder ID in which the alias will be created (target)
  'foldRef': 789 // Number | Folder ID of the referenced folder (source)
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createAliasFolder(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **parentId** | **Number**| Folder ID in which the alias will be created (target) | [optional] 
 **foldRef** | **Number**| Folder ID of the referenced folder (source) | [optional] 

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="createFolder"></a>
# **createFolder**
> 'Number' createFolder(opts)

Creates a subfolder



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'parentId': 789, // Number | The ID of the parent folder
  'name': "name_example" // String | Name of the new folder
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createFolder(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **parentId** | **Number**| The ID of the parent folder | [optional] 
 **name** | **String**| Name of the new folder | [optional] 

### Return type

**'Number'**

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: text/plain, application/json, application/xml

<a name="createFolderByModel"></a>
# **createFolderByModel**
> WSFolder createFolderByModel(body)

Creates a new folder

The 'folder' metadata comes in the POST request body (encoded as JSON). Note: folder object must specify at least fields name and parentId

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var body = new LogicalDocRestApi.WSFolder(); // WSFolder | The folder metadata


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createFolderByModel(body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**WSFolder**](WSFolder.md)| The folder metadata | 

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="createPath"></a>
# **createPath**
> WSFolder createPath(opts)

Creates a path

Creates a path of folders starting from a parent folder. It returns the metadata object representing the latest created folder in the path

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'parentId': 789, // Number | The parent folder ID from which the new path will start
  'path': "path_example" // String | The path to create
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createPath(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **parentId** | **Number**| The parent folder ID from which the new path will start | [optional] 
 **path** | **String**| The path to create | [optional] 

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="createSimple"></a>
# **createSimple**
> WSFolder createSimple(opts)

Creates folders from path

Creates folders using an input path. All the folders in the path will be created. It returns the metadata object representing the latest created folder in the path. Example: curl -u admin:admin -X POST -H ''Content-Type: text/plain'' -H ''Accept: application/json'' -d ''/Default/Curl/newfolder'' http://localhost:8080/services/rest/folder/createSimple

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'body': "body_example" // String | The string representing the path to be created
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createSimple(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | **String**| The string representing the path to be created | [optional] 

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: text/plain, application/json
 - **Accept**: application/json

<a name="createSimpleForm"></a>
# **createSimpleForm**
> WSFolder createSimpleForm(opts)

Creates folders from path

Creates folders using an input path. All the folders in the path will be created. It returns the metadata object representing the latest created folder in the path

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'folderPath': "folderPath_example" // String | The string representing the path to be created
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createSimpleForm(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderPath** | **String**| The string representing the path to be created | [optional] 

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="createSimpleJSON"></a>
# **createSimpleJSON**
> WSFolder createSimpleJSON(opts)

Creates folders from path

Creates folders using an input path. All the folders in the path will be created. It returns the metadata object representing the latest created folder in the path

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'folderPath': "folderPath_example" // String | The string representing the path to be created
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createSimpleJSON(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderPath** | **String**| The string representing the path to be created | [optional] 

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="deleteFolder"></a>
# **deleteFolder**
> deleteFolder(folderId)

Deletes a folder



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | The ID of the folder to be deleted


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteFolder(folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| The ID of the folder to be deleted | 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="findByPath"></a>
# **findByPath**
> WSFolder findByPath(opts)

Gets a folder

Finds the folder at the specified path

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'path': "path_example" // String | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findByPath(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **path** | **String**|  | [optional] 

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getDefaultWorkspace"></a>
# **getDefaultWorkspace**
> WSFolder getDefaultWorkspace()

Gets the Default workspace



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getDefaultWorkspace(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getFolder"></a>
# **getFolder**
> WSFolder getFolder(folderId)

Gets a folder

Gets the folder with the specified ID

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | The folder ID


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getFolder(folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| The folder ID | 

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json, application/xml

<a name="getGrantedGroups"></a>
# **getGrantedGroups**
> [WSRight] getGrantedGroups(folderId)

Retrieves the list of granted groups for the given folder



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | Folder identifier (ID)


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getGrantedGroups(folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| Folder identifier (ID) | 

### Return type

[**[WSRight]**](WSRight.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getGrantedUsers"></a>
# **getGrantedUsers**
> [WSRight] getGrantedUsers(folderId)

Retrieves the list of granted users for the given folder



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | Folder identifier (ID)


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getGrantedUsers(folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| Folder identifier (ID) | 

### Return type

[**[WSRight]**](WSRight.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getPath"></a>
# **getPath**
> [WSFolder] getPath(folderId)

Gets a path of folders

Returns the folders that make up the path to the folder in input.

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | Folder identifier (ID)


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getPath(folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| Folder identifier (ID) | 

### Return type

[**[WSFolder]**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getPathString"></a>
# **getPathString**
> 'String' getPathString(folderId)

Gets a path

Returns the path to the folder in input.

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | Folder identifier (ID)


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getPathString(folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| Folder identifier (ID) | 

### Return type

**'String'**

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getRootFolder"></a>
# **getRootFolder**
> WSFolder getRootFolder()

Gets the root folder

Gets the root folder in the current tenant

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getRootFolder(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**WSFolder**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="grantGroup"></a>
# **grantGroup**
> grantGroup(folderId, groupId, permissions, recursive)

Grants group permission to the folder



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | Folder identifier (ID)

var groupId = 789; // Number | Group identifier (ID)

var permissions = 56; // Number | the permission integer representation. If '0', the group will be not granted to access the folder

var recursive = true; // Boolean | recursion option. If true, the grant operation is applied also to the subfolders


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.grantGroup(folderId, groupId, permissions, recursive, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| Folder identifier (ID) | 
 **groupId** | **Number**| Group identifier (ID) | 
 **permissions** | **Number**| the permission integer representation. If '0', the group will be not granted to access the folder | 
 **recursive** | **Boolean**| recursion option. If true, the grant operation is applied also to the subfolders | 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="grantUser"></a>
# **grantUser**
> grantUser(folderId, userId, permissions, recursive)

Grants user permission to the folder



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | Folder identifier (ID)

var userId = 789; // Number | User identifier (ID)

var permissions = 56; // Number | the permission integer representation. If '0', the user will be not granted to access the folder

var recursive = true; // Boolean | recursion option. If true, the grant operation is applied also to the subfolders


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.grantUser(folderId, userId, permissions, recursive, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| Folder identifier (ID) | 
 **userId** | **Number**| User identifier (ID) | 
 **permissions** | **Number**| the permission integer representation. If '0', the user will be not granted to access the folder | 
 **recursive** | **Boolean**| recursion option. If true, the grant operation is applied also to the subfolders | 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="isGranted"></a>
# **isGranted**
> 'Boolean' isGranted(folderId, permission)

Tests user permission on a folder

Tests if the current user has a specific permission on a folder

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | Folder identifier (ID)

var permission = 56; // Number | the permissions' integer representation


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.isGranted(folderId, permission, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| Folder identifier (ID) | 
 **permission** | **Number**| the permissions' integer representation | 

### Return type

**'Boolean'**

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="isReadableFolder"></a>
# **isReadableFolder**
> 'Boolean' isReadableFolder(opts)

Tests if a folder is readable



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'folderId': 789 // Number | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.isReadableFolder(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**|  | [optional] 

### Return type

**'Boolean'**

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="isWritable"></a>
# **isWritable**
> 'Boolean' isWritable(opts)

Tests if a folder is writable



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'folderId': 789 // Number | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.isWritable(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**|  | [optional] 

### Return type

**'Boolean'**

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="listChildren"></a>
# **listChildren**
> [WSFolder] listChildren(folderId)

Lists the child folders

Returns the list of child folders. Example: curl -u admin:admin -H ''Accept: application/json'' http://localhost:8080/services/rest/folder/listChildren?folderId=4

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var folderId = 789; // Number | The ID of the parent folder


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listChildren(folderId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**| The ID of the parent folder | 

### Return type

[**[WSFolder]**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json, application/xml

<a name="listWorkspaces"></a>
# **listWorkspaces**
> [WSFolder] listWorkspaces()

Retrieves the list of all workspaces



### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listWorkspaces(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**[WSFolder]**](WSFolder.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="moveFolder"></a>
# **moveFolder**
> moveFolder(opts)

Moves a folder

Updates a folder by changing its parent. The folder is moved to the new parent folder.

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'folderId': 789, // Number | 
  'parentId': 789 // Number | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.moveFolder(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**|  | [optional] 
 **parentId** | **Number**|  | [optional] 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="renameFolder"></a>
# **renameFolder**
> renameFolder(opts)

Renames a folder

Changes the name of a given folder

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'folderId': 789, // Number | 
  'name': "name_example" // String | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.renameFolder(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **folderId** | **Number**|  | [optional] 
 **name** | **String**|  | [optional] 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="updateFolder"></a>
# **updateFolder**
> updateFolder(opts)

Updates a folder

Updates a folder changing its metadata. The folder object in input must specify the property id

### Example
```javascript
var LogicalDocRestApi = require('logical_doc_rest_api');
var defaultClient = LogicalDocRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new LogicalDocRestApi.FolderApi();

var opts = { 
  'body': new LogicalDocRestApi.WSFolder() // WSFolder | A value object with the metadata of the folder to update
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateFolder(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**WSFolder**](WSFolder.md)| A value object with the metadata of the folder to update | [optional] 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

