# TasksApi

All URIs are relative to *http://localhost:8889/api*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**_delete**](#_delete) | **DELETE** /tasks/{taskId} | Delete task|
|[**create**](#create) | **POST** /tasks | Create task|
|[**getAll**](#getall) | **GET** /tasks | Gets tasks|
|[**getById**](#getbyid) | **GET** /tasks/{taskId} | Get task|
|[**patch**](#patch) | **PATCH** /tasks/{taskId} | Partially update task|
|[**update**](#update) | **PUT** /tasks/{taskId} | Update task|

# **_delete**
> _delete()


### Example

```typescript
import {
    TasksApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new TasksApi(configuration);

let taskId: string; //The ID or encoded key of the task. (default to undefined)

const { status, data } = await apiInstance._delete(
    taskId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **taskId** | [**string**] | The ID or encoded key of the task. | defaults to undefined|


### Return type

void (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | Task deleted. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Task not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create**
> Task create(task)


### Example

```typescript
import {
    TasksApi,
    Configuration,
    Task
} from './api';

const configuration = new Configuration();
const apiInstance = new TasksApi(configuration);

let task: Task; //Task to be created.
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)

const { status, data } = await apiInstance.create(
    task,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **task** | **Task**| Task to be created. | |
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|


### Return type

**Task**

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**102** | Your idempotent request was already submitted and is currently being processed, try again later. |  -  |
|**201** | Task created. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getAll**
> Array<Task> getAll()


### Example

```typescript
import {
    TasksApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new TasksApi(configuration);

let offset: number; //Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results (optional) (default to undefined)
let limit: number; //Pagination, the number of elements to retrieve, used in combination with offset to paginate results (optional) (default to undefined)
let paginationDetails: 'ON' | 'OFF'; //Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs (optional) (default to 'OFF')
let detailsLevel: 'BASIC' | 'FULL'; //The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. (optional) (default to undefined)
let username: string; //The username. (optional) (default to undefined)
let clientId: string; //The ID or encoded key of the client. (optional) (default to undefined)
let groupId: string; //The ID of encoded key of the group. (optional) (default to undefined)
let status: 'OPEN' | 'COMPLETED'; //The task status. (optional) (default to undefined)

const { status, data } = await apiInstance.getAll(
    offset,
    limit,
    paginationDetails,
    detailsLevel,
    username,
    clientId,
    groupId,
    status
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **offset** | [**number**] | Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results | (optional) defaults to undefined|
| **limit** | [**number**] | Pagination, the number of elements to retrieve, used in combination with offset to paginate results | (optional) defaults to undefined|
| **paginationDetails** | [**&#39;ON&#39; | &#39;OFF&#39;**]**Array<&#39;ON&#39; &#124; &#39;OFF&#39;>** | Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs | (optional) defaults to 'OFF'|
| **detailsLevel** | [**&#39;BASIC&#39; | &#39;FULL&#39;**]**Array<&#39;BASIC&#39; &#124; &#39;FULL&#39;>** | The level of details to return: &#x60;FULL&#x60; means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and &#x60;BASIC&#x60; will return only the first level elements of the object. | (optional) defaults to undefined|
| **username** | [**string**] | The username. | (optional) defaults to undefined|
| **clientId** | [**string**] | The ID or encoded key of the client. | (optional) defaults to undefined|
| **groupId** | [**string**] | The ID of encoded key of the group. | (optional) defaults to undefined|
| **status** | [**&#39;OPEN&#39; | &#39;COMPLETED&#39;**]**Array<&#39;OPEN&#39; &#124; &#39;COMPLETED&#39;>** | The task status. | (optional) defaults to undefined|


### Return type

**Array<Task>**

### Authorization

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

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Tasks list returned. |  * Items-Limit - Pagination details, the requested page size <br>  * Items-Offset - Pagination details, the index of the first returned item <br>  * Items-Total - Pagination details, the total available items <br>  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getById**
> Task getById()


### Example

```typescript
import {
    TasksApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new TasksApi(configuration);

let taskId: string; //The ID or encoded key of the task. (default to undefined)

const { status, data } = await apiInstance.getById(
    taskId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **taskId** | [**string**] | The ID or encoded key of the task. | defaults to undefined|


### Return type

**Task**

### Authorization

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

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Task returned. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Task not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **patch**
> patch(patchOperation)


### Example

```typescript
import {
    TasksApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new TasksApi(configuration);

let taskId: string; //The ID or encoded key of the task. (default to undefined)
let patchOperation: Array<PatchOperation>; //Patch operations to be applied to a resource.

const { status, data } = await apiInstance.patch(
    taskId,
    patchOperation
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **patchOperation** | **Array<PatchOperation>**| Patch operations to be applied to a resource. | |
| **taskId** | [**string**] | The ID or encoded key of the task. | defaults to undefined|


### Return type

void (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | Task updated. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Task not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **update**
> Task update(task)


### Example

```typescript
import {
    TasksApi,
    Configuration,
    Task
} from './api';

const configuration = new Configuration();
const apiInstance = new TasksApi(configuration);

let taskId: string; //The ID or encoded key of the task. (default to undefined)
let task: Task; //The task to be updated.

const { status, data } = await apiInstance.update(
    taskId,
    task
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **task** | **Task**| The task to be updated. | |
| **taskId** | [**string**] | The ID or encoded key of the task. | defaults to undefined|


### Return type

**Task**

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Task updated. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Task not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

