# CloudSmlApi.WorkspacesApi

All URIs are relative to *https://localhost/api/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addWorkspaceMember**](WorkspacesApi.md#addWorkspaceMember) | **POST** /workspaces/{workspace_id}/members/ | Add a new member to a workspace
[**createWorkspace**](WorkspacesApi.md#createWorkspace) | **POST** /workspaces/ | Create a new workspace
[**deleteWorkspaceById**](WorkspacesApi.md#deleteWorkspaceById) | **DELETE** /workspaces/{workspace_id} | Delete a workspace by ID
[**deleteWorkspaceMemberById**](WorkspacesApi.md#deleteWorkspaceMemberById) | **DELETE** /workspaces/{workspace_id}/members/{user_id} | Remove a member from a workspace
[**getWorkspaceById**](WorkspacesApi.md#getWorkspaceById) | **GET** /workspaces/{workspace_id} | Get workspace details by ID
[**getWorkspaceMembers**](WorkspacesApi.md#getWorkspaceMembers) | **GET** /workspaces/{workspace_id}/members/ | Get workspace members by workspace ID
[**getWorkspaces**](WorkspacesApi.md#getWorkspaces) | **GET** /workspaces/ | List of workspaces
[**optionsWorkspaceById**](WorkspacesApi.md#optionsWorkspaceById) | **OPTIONS** /workspaces/{workspace_id} | Check which methods are allowed
[**optionsWorkspaceMemberById**](WorkspacesApi.md#optionsWorkspaceMemberById) | **OPTIONS** /workspaces/{workspace_id}/members/{user_id} | Check which methods are allowed
[**optionsWorkspaceMembers**](WorkspacesApi.md#optionsWorkspaceMembers) | **OPTIONS** /workspaces/{workspace_id}/members/ | Check which methods are allowed
[**optionsWorkspaces**](WorkspacesApi.md#optionsWorkspaces) | **OPTIONS** /workspaces/ | Check which methods are allowed
[**patchWorkspaceById**](WorkspacesApi.md#patchWorkspaceById) | **PATCH** /workspaces/{workspace_id} | Patch workspace details by ID


<a name="addWorkspaceMember"></a>
# **addWorkspaceMember**
> BaseWorkspaceMember addWorkspaceMember(workspaceIduserId, opts)

Add a new member to a workspace

**PERMISSIONS: Owner/Supervisor/Admin may execute this action.**

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 

var userId = 56; // Number | 

var opts = { 
  'role': "role_example" // String | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 
 **userId** | **Number**|  | 
 **role** | **String**|  | [optional] 

### Return type

[**BaseWorkspaceMember**](BaseWorkspaceMember.md)

### Authorization

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

### HTTP request headers

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

<a name="createWorkspace"></a>
# **createWorkspace**
> DetailedWorkspace createWorkspace(title)

Create a new workspace

**PERMISSIONS: At least Active user is required.**

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var title = "title_example"; // String | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **title** | **String**|  | 

### Return type

[**DetailedWorkspace**](DetailedWorkspace.md)

### Authorization

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

### HTTP request headers

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

<a name="deleteWorkspaceById"></a>
# **deleteWorkspaceById**
> deleteWorkspaceById(workspaceId)

Delete a workspace by ID

**PERMISSIONS: Owner/Supervisor/Admin may execute this action.**

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="deleteWorkspaceMemberById"></a>
# **deleteWorkspaceMemberById**
> deleteWorkspaceMemberById(workspaceId, userId)

Remove a member from a workspace

**PERMISSIONS: Owner/Supervisor/Admin may execute this action.**

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 

var userId = 56; // Number | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 
 **userId** | **Number**|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="getWorkspaceById"></a>
# **getWorkspaceById**
> DetailedWorkspace getWorkspaceById(workspaceId)

Get workspace details by ID

**PERMISSIONS: Owner/Supervisor/Admin may execute this action.**

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 

### Return type

[**DetailedWorkspace**](DetailedWorkspace.md)

### Authorization

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

### HTTP request headers

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

<a name="getWorkspaceMembers"></a>
# **getWorkspaceMembers**
> [BaseWorkspaceMember] getWorkspaceMembers(workspaceId, opts)

Get workspace members by workspace ID

**PERMISSIONS: Owner/Supervisor/Admin may execute this action.**

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 

var opts = { 
  'offset': 56, // Number | a number of items to skip, default is 0.
  'limit': 20 // Number | limit a number of items (allowed range is 1-100), default is 20.
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 
 **offset** | **Number**| a number of items to skip, default is 0. | [optional] 
 **limit** | **Number**| limit a number of items (allowed range is 1-100), default is 20. | [optional] [default to 20]

### Return type

[**[BaseWorkspaceMember]**](BaseWorkspaceMember.md)

### Authorization

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

### HTTP request headers

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

<a name="getWorkspaces"></a>
# **getWorkspaces**
> [BaseWorkspace] getWorkspaces(opts)

List of workspaces

**PERMISSIONS: At least Active user is required.**   Returns a list of workspaces starting from &#x60;&#x60;offset&#x60;&#x60; limited by &#x60;&#x60;limit&#x60;&#x60; parameter.

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var opts = { 
  'offset': 56, // Number | a number of items to skip, default is 0.
  'limit': 20, // Number | limit a number of items (allowed range is 1-100), default is 20.
  'userId': 56 // Number | filter workspaces to show only those which have user_id as a member
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **offset** | **Number**| a number of items to skip, default is 0. | [optional] 
 **limit** | **Number**| limit a number of items (allowed range is 1-100), default is 20. | [optional] [default to 20]
 **userId** | **Number**| filter workspaces to show only those which have user_id as a member | [optional] 

### Return type

[**[BaseWorkspace]**](BaseWorkspace.md)

### Authorization

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

### HTTP request headers

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

<a name="optionsWorkspaceById"></a>
# **optionsWorkspaceById**
> optionsWorkspaceById(workspaceId)

Check which methods are allowed

**PERMISSIONS: At least Active user is required.**   Use this method if you need to know what operations are allowed to be performed on this endpoint, e.g. to decide wether to display a button in your UI.  The list of allowed methods is provided in &#x60;Allow&#x60; response header.

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="optionsWorkspaceMemberById"></a>
# **optionsWorkspaceMemberById**
> optionsWorkspaceMemberById(workspaceId, userId)

Check which methods are allowed

**PERMISSIONS: At least Active user is required.**   Use this method if you need to know what operations are allowed to be performed on this endpoint, e.g. to decide wether to display a button in your UI.  The list of allowed methods is provided in &#x60;Allow&#x60; response header.

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 

var userId = 56; // Number | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 
 **userId** | **Number**|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="optionsWorkspaceMembers"></a>
# **optionsWorkspaceMembers**
> optionsWorkspaceMembers(workspaceId)

Check which methods are allowed

**PERMISSIONS: At least Active user is required.**   Use this method if you need to know what operations are allowed to be performed on this endpoint, e.g. to decide wether to display a button in your UI.  The list of allowed methods is provided in &#x60;Allow&#x60; response header.

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="optionsWorkspaces"></a>
# **optionsWorkspaces**
> optionsWorkspaces()

Check which methods are allowed

**PERMISSIONS: At least Active user is required.**   Use this method if you need to know what operations are allowed to be performed on this endpoint, e.g. to decide wether to display a button in your UI.  The list of allowed methods is provided in &#x60;Allow&#x60; response header.

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

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

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

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="patchWorkspaceById"></a>
# **patchWorkspaceById**
> DetailedWorkspace patchWorkspaceById(workspaceIdbody)

Patch workspace details by ID

**PERMISSIONS: Owner/Supervisor/Admin may execute this action.**

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.WorkspacesApi();

var workspaceId = 56; // Number | 

var body = [new CloudSmlApi.Body6()]; // [Body6] | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **workspaceId** | **Number**|  | 
 **body** | [**[Body6]**](Body6.md)|  | 

### Return type

[**DetailedWorkspace**](DetailedWorkspace.md)

### Authorization

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

### HTTP request headers

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

