Skip to content

Commit

Permalink
Updated JavaScript SDK: v3.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
asana-publish-client-libraries[bot] committed Mar 25, 2024
1 parent 67c10b0 commit 15c5e2b
Show file tree
Hide file tree
Showing 43 changed files with 897 additions and 43 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# asana [![GitHub release][release-image]][release-url] [![NPM Version][npm-image]][npm-url]

- API version: 1.0
- Package version: 3.0.3
- Package version: 3.0.4

## Installation

Expand All @@ -18,7 +18,7 @@ npm install asana --save
Include the latest release directly from GitHub:

```html
<script src="https://github.com/Asana/node-asana/releases/download/v3.0.3/asana-min.js"></script>
<script src="https://github.com/Asana/node-asana/releases/download/v3.0.4/asana-min.js"></script>
```

Example usage (**NOTE**: be careful not to expose your access token):
Expand Down Expand Up @@ -195,6 +195,11 @@ All URIs are relative to *https://app.asana.com/api/1.0*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*Asana.AllocationsApi* | [**createAllocation**](docs/AllocationsApi.md#createAllocation) | **POST** /allocations | Create an allocation
*Asana.AllocationsApi* | [**deleteAllocation**](docs/AllocationsApi.md#deleteAllocation) | **DELETE** /allocations/{allocation_gid} | Delete an allocation
*Asana.AllocationsApi* | [**getAllocation**](docs/AllocationsApi.md#getAllocation) | **GET** /allocations/{allocation_gid} | Get an allocation
*Asana.AllocationsApi* | [**getAllocations**](docs/AllocationsApi.md#getAllocations) | **GET** /allocations | Get multiple allocations
*Asana.AllocationsApi* | [**updateAllocation**](docs/AllocationsApi.md#updateAllocation) | **PUT** /allocations/{allocation_gid} | Update an allocation
*Asana.AttachmentsApi* | [**createAttachmentForObject**](docs/AttachmentsApi.md#createAttachmentForObject) | **POST** /attachments | Upload an attachment
*Asana.AttachmentsApi* | [**deleteAttachment**](docs/AttachmentsApi.md#deleteAttachment) | **DELETE** /attachments/{attachment_gid} | Delete an attachment
*Asana.AttachmentsApi* | [**getAttachment**](docs/AttachmentsApi.md#getAttachment) | **GET** /attachments/{attachment_gid} | Get an attachment
Expand Down Expand Up @@ -1106,6 +1111,6 @@ client.callApi(
```

[release-image]: https://img.shields.io/github/release/asana/node-asana.svg
[release-url]: https://github.com/Asana/node-asana/releases/tag/v3.0.3
[release-url]: https://github.com/Asana/node-asana/releases/tag/v3.0.4
[npm-image]: http://img.shields.io/npm/v/asana.svg?style=flat-square
[npm-url]: https://www.npmjs.org/package/asana
249 changes: 249 additions & 0 deletions docs/AllocationsApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
# Asana.AllocationsApi

All URIs are relative to *https://app.asana.com/api/1.0*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createAllocation**](AllocationsApi.md#createAllocation) | **POST** /allocations | Create an allocation
[**deleteAllocation**](AllocationsApi.md#deleteAllocation) | **DELETE** /allocations/{allocation_gid} | Delete an allocation
[**getAllocation**](AllocationsApi.md#getAllocation) | **GET** /allocations/{allocation_gid} | Get an allocation
[**getAllocations**](AllocationsApi.md#getAllocations) | **GET** /allocations | Get multiple allocations
[**updateAllocation**](AllocationsApi.md#updateAllocation) | **PUT** /allocations/{allocation_gid} | Update an allocation

<a name="createAllocation"></a>
# **createAllocation**

Create an allocation

Creates a new allocation. Returns the full record of the newly created allocation.

([more information](https://developers.asana.com/reference/createallocation))

### Example
```javascript
const Asana = require('asana');

let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';

let allocationsApiInstance = new Asana.AllocationsApi();
let body = {"data": {"<PARAM_1>": "<VALUE_1>", "<PARAM_2>": "<VALUE_2>",}}; // Object | The allocation to create.
let opts = {
'opt_fields': "assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,resource_subtype,start_date"
};
allocationsApiInstance.createAllocation(body, opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});

```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **Object**| The allocation to create. |
**opt_fields** | **Object**| This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional]

### Return type

object

### HTTP request headers

- **Content-Type**: application/json; charset=UTF-8
- **Accept**: application/json; charset=UTF-8

<a name="deleteAllocation"></a>
# **deleteAllocation**

Delete an allocation

A specific, existing allocation can be deleted by making a DELETE request on the URL for that allocation. Returns an empty data record.

([more information](https://developers.asana.com/reference/deleteallocation))

### Example
```javascript
const Asana = require('asana');

let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';

let allocationsApiInstance = new Asana.AllocationsApi();
let allocation_gid = "77688"; // String | Globally unique identifier for the allocation.

allocationsApiInstance.deleteAllocation(allocation_gid).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});

```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**allocation_gid** | **String**| Globally unique identifier for the allocation. |

### Return type

object

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json; charset=UTF-8

<a name="getAllocation"></a>
# **getAllocation**

Get an allocation

Returns the complete allocation record for a single allocation.

([more information](https://developers.asana.com/reference/getallocation))

### Example
```javascript
const Asana = require('asana');

let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';

let allocationsApiInstance = new Asana.AllocationsApi();
let allocation_gid = "77688"; // String | Globally unique identifier for the allocation.
let opts = {
'opt_fields': "assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,resource_subtype,start_date"
};
allocationsApiInstance.getAllocation(allocation_gid, opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});

```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**allocation_gid** | **String**| Globally unique identifier for the allocation. |
**opt_fields** | **Object**| This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional]

### Return type

object

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json; charset=UTF-8

<a name="getAllocations"></a>
# **getAllocations**

Get multiple allocations

Returns a list of allocations filtered to a specific project or user.

([more information](https://developers.asana.com/reference/getallocations))

### Example
```javascript
const Asana = require('asana');

let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';

let allocationsApiInstance = new Asana.AllocationsApi();
let opts = {
'parent': "77688",
'assignee': "12345",
'workspace': "98765",
'limit': 50,
'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9",
'opt_fields': "assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,offset,parent,parent.name,path,resource_subtype,start_date,uri"
};
allocationsApiInstance.getAllocations(opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});

```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**parent** | **String**| Globally unique identifier for the project to filter allocations by. | [optional]
**assignee** | **String**| Globally unique identifier for the user the allocation is assigned to. | [optional]
**workspace** | **String**| Globally unique identifier for the workspace. | [optional]
**limit** | **Number**| Results per page. The number of objects to return per page. The value must be between 1 and 100. | [optional]
**offset** | **String**| Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. &#x27;Note: You can only pass in an offset that was returned to you via a previously paginated request.&#x27; | [optional]
**opt_fields** | **Object**| This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional]

### Return type

object

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json; charset=UTF-8

<a name="updateAllocation"></a>
# **updateAllocation**

Update an allocation

An existing allocation can be updated by making a PUT request on the URL for that allocation. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated allocation record.

([more information](https://developers.asana.com/reference/updateallocation))

### Example
```javascript
const Asana = require('asana');

let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';

let allocationsApiInstance = new Asana.AllocationsApi();
let body = {"data": {"<PARAM_1>": "<VALUE_1>", "<PARAM_2>": "<VALUE_2>",}}; // Object | The updated fields for the allocation.
let allocation_gid = "77688"; // String | Globally unique identifier for the allocation.
let opts = {
'opt_fields': "assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,resource_subtype,start_date"
};
allocationsApiInstance.updateAllocation(body, allocation_gid, opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});

```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **Object**| The updated fields for the allocation. |
**allocation_gid** | **String**| Globally unique identifier for the allocation. |
**opt_fields** | **Object**| This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional]

### Return type

object

### HTTP request headers

- **Content-Type**: application/json; charset=UTF-8
- **Accept**: application/json; charset=UTF-8

94 changes: 94 additions & 0 deletions docs/AllocationsApi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
AllocationsApi:
createAllocation: |-
const Asana = require('asana');
let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';
let allocationsApiInstance = new Asana.AllocationsApi();
let body = {"data": {"<PARAM_1>": "<VALUE_1>", "<PARAM_2>": "<VALUE_2>",}}; // Object | The allocation to create.
let opts = {
'opt_fields': "assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,resource_subtype,start_date"
};
allocationsApiInstance.createAllocation(body, opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});
deleteAllocation: |-
const Asana = require('asana');
let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';
let allocationsApiInstance = new Asana.AllocationsApi();
let allocation_gid = "77688"; // String | Globally unique identifier for the allocation.
allocationsApiInstance.deleteAllocation(allocation_gid).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});
getAllocation: |-
const Asana = require('asana');
let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';
let allocationsApiInstance = new Asana.AllocationsApi();
let allocation_gid = "77688"; // String | Globally unique identifier for the allocation.
let opts = {
'opt_fields': "assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,resource_subtype,start_date"
};
allocationsApiInstance.getAllocation(allocation_gid, opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});
getAllocations: |-
const Asana = require('asana');
let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';
let allocationsApiInstance = new Asana.AllocationsApi();
let opts = {
'parent': "77688",
'assignee': "12345",
'workspace': "98765",
'limit': 50,
'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9",
'opt_fields': "assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,offset,parent,parent.name,path,resource_subtype,start_date,uri"
};
allocationsApiInstance.getAllocations(opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});
updateAllocation: |-
const Asana = require('asana');
let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';
let allocationsApiInstance = new Asana.AllocationsApi();
let body = {"data": {"<PARAM_1>": "<VALUE_1>", "<PARAM_2>": "<VALUE_2>",}}; // Object | The updated fields for the allocation.
let allocation_gid = "77688"; // String | Globally unique identifier for the allocation.
let opts = {
'opt_fields': "assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,resource_subtype,start_date"
};
allocationsApiInstance.updateAllocation(body, allocation_gid, opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asana",
"version": "3.0.3",
"version": "3.0.4",
"description": "This_is_the_interface_for_interacting_with_the__Asana_Platform_httpsdevelopers_asana_com__Our_API_reference_is_generated_from_our__OpenAPI_spec__httpsraw_githubusercontent_comAsanaopenapimasterdefsasana_oas_yaml_",
"license": "Apache 2.0",
"main": "src/index.js",
Expand Down

0 comments on commit 15c5e2b

Please sign in to comment.