From 15c5e2bdc58bc5947a06c460c42983de444ce0ee Mon Sep 17 00:00:00 2001 From: "asana-publish-client-libraries[bot]" <159857493+asana-publish-client-libraries[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:53:59 +0000 Subject: [PATCH] Updated JavaScript SDK: v3.0.4 --- README.md | 11 +- docs/AllocationsApi.md | 249 ++++++++++++++++++++ docs/AllocationsApi.yaml | 94 ++++++++ package.json | 2 +- src/ApiClient.js | 6 +- src/api/AllocationsApi.js | 365 +++++++++++++++++++++++++++++ src/api/AttachmentsApi.js | 2 +- src/api/AuditLogAPIApi.js | 2 +- src/api/BatchAPIApi.js | 2 +- src/api/CustomFieldSettingsApi.js | 2 +- src/api/CustomFieldsApi.js | 2 +- src/api/EventsApi.js | 2 +- src/api/GoalRelationshipsApi.js | 2 +- src/api/GoalsApi.js | 2 +- src/api/JobsApi.js | 2 +- src/api/MembershipsApi.js | 2 +- src/api/OrganizationExportsApi.js | 2 +- src/api/PortfolioMembershipsApi.js | 2 +- src/api/PortfoliosApi.js | 2 +- src/api/ProjectBriefsApi.js | 2 +- src/api/ProjectMembershipsApi.js | 2 +- src/api/ProjectStatusesApi.js | 2 +- src/api/ProjectTemplatesApi.js | 2 +- src/api/ProjectsApi.js | 2 +- src/api/RulesApi.js | 2 +- src/api/SectionsApi.js | 2 +- src/api/StatusUpdatesApi.js | 2 +- src/api/StoriesApi.js | 2 +- src/api/TagsApi.js | 2 +- src/api/TaskTemplatesApi.js | 2 +- src/api/TasksApi.js | 2 +- src/api/TeamMembershipsApi.js | 2 +- src/api/TeamsApi.js | 2 +- src/api/TimePeriodsApi.js | 2 +- src/api/TimeTrackingEntriesApi.js | 2 +- src/api/TypeaheadApi.js | 2 +- src/api/UserTaskListsApi.js | 2 +- src/api/UsersApi.js | 2 +- src/api/WebhooksApi.js | 2 +- src/api/WorkspaceMembershipsApi.js | 2 +- src/api/WorkspacesApi.js | 2 +- src/index.js | 9 +- test/api/AllocationsApi.spec.js | 134 +++++++++++ 43 files changed, 897 insertions(+), 43 deletions(-) create mode 100644 docs/AllocationsApi.md create mode 100644 docs/AllocationsApi.yaml create mode 100644 src/api/AllocationsApi.js create mode 100644 test/api/AllocationsApi.spec.js diff --git a/README.md b/README.md index 0b1c1899..e666976e 100644 --- a/README.md +++ b/README.md @@ -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 @@ -18,7 +18,7 @@ npm install asana --save Include the latest release directly from GitHub: ```html - + ``` Example usage (**NOTE**: be careful not to expose your access token): @@ -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 @@ -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 diff --git a/docs/AllocationsApi.md b/docs/AllocationsApi.md new file mode 100644 index 00000000..b96233ba --- /dev/null +++ b/docs/AllocationsApi.md @@ -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 + + +# **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 = ''; + +let allocationsApiInstance = new Asana.AllocationsApi(); +let body = {"data": {"": "", "": "",}}; // 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 + + +# **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 = ''; + +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 + + +# **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 = ''; + +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 + + +# **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 = ''; + +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. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' | [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 + + +# **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 = ''; + +let allocationsApiInstance = new Asana.AllocationsApi(); +let body = {"data": {"": "", "": "",}}; // 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 + diff --git a/docs/AllocationsApi.yaml b/docs/AllocationsApi.yaml new file mode 100644 index 00000000..ff53c227 --- /dev/null +++ b/docs/AllocationsApi.yaml @@ -0,0 +1,94 @@ +AllocationsApi: + createAllocation: |- + const Asana = require('asana'); + + let client = Asana.ApiClient.instance; + let token = client.authentications['token']; + token.accessToken = ''; + + let allocationsApiInstance = new Asana.AllocationsApi(); + let body = {"data": {"": "", "": "",}}; // 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 = ''; + + 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 = ''; + + 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 = ''; + + 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 = ''; + + let allocationsApiInstance = new Asana.AllocationsApi(); + let body = {"data": {"": "", "": "",}}; // 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); + }); + diff --git a/package.json b/package.json index 3ad79c57..793a2c5f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/ApiClient.js b/src/ApiClient.js index fdd19ae8..406df9b3 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -16,7 +16,7 @@ import superagent from "superagent"; /** * @module ApiClient -* @version 3.0.3 +* @version 3.0.4 */ /** @@ -412,7 +412,7 @@ export class ApiClient { if (typeof(navigator) === 'undefined' || typeof(window) === 'undefined') { headerParams['X-Asana-Client-Lib'] = new URLSearchParams( { - 'version': "3.0.3", + 'version': "3.0.4", 'language': 'NodeJS', 'language_version': process.version, 'os': process.platform @@ -421,7 +421,7 @@ export class ApiClient { } else { headerParams['X-Asana-Client-Lib'] = new URLSearchParams( { - 'version': "3.0.3", + 'version': "3.0.4", 'language': 'BrowserJS' } ).toString(); diff --git a/src/api/AllocationsApi.js b/src/api/AllocationsApi.js new file mode 100644 index 00000000..77d4dda0 --- /dev/null +++ b/src/api/AllocationsApi.js @@ -0,0 +1,365 @@ +/* + * Asana + * This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml). + * + * OpenAPI spec version: 1.0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.54 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from "../ApiClient"; +var Collection = require('../utils/collection'); + +/** +* Allocations service. +* @module api/AllocationsApi +* @version 3.0.4 +*/ +export class AllocationsApi { + + /** + * Constructs a new AllocationsApi. + * @alias module:api/AllocationsApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instanc + e} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * Create an allocation + * Creates a new allocation. Returns the full record of the newly created allocation. + * @param {module:model/Object} body The allocation to create. + * @param {Object} opts Optional parameters + * @param {Array.} opts.opt_fields 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. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response + */ + createAllocationWithHttpInfo(body, opts) { + opts = opts || {}; + let postBody = body; + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling createAllocation"); + } + + let pathParams = { + + }; + let queryParams = {}; + opts = opts || {}; + queryParams = opts; + + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['personalAccessToken']; + let contentTypes = ['application/json; charset=UTF-8']; + let accepts = ['application/json; charset=UTF-8']; + let returnType = 'Blob'; + + return this.apiClient.callApi( + '/allocations', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * Create an allocation + * Creates a new allocation. Returns the full record of the newly created allocation. + * @param {<&vendorExtensions.x-jsdoc-type>} body The allocation to create. + * @param {Object} opts Optional parameters + * @param {Array.} opts.opt_fields 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. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AllocationResponseData} + */ + createAllocation(body, opts) { + + return this.createAllocationWithHttpInfo(body, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * 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. + * @param {String} allocation_gid Globally unique identifier for the allocation. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response + */ + deleteAllocationWithHttpInfo(allocation_gid) { + + let postBody = null; + // verify the required parameter 'allocation_gid' is set + if (allocation_gid === undefined || allocation_gid === null) { + throw new Error("Missing the required parameter 'allocation_gid' when calling deleteAllocation"); + } + + let pathParams = { + 'allocation_gid': allocation_gid + }; + let queryParams = {}; + + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['personalAccessToken']; + let contentTypes = []; + let accepts = ['application/json; charset=UTF-8']; + let returnType = 'Blob'; + + return this.apiClient.callApi( + '/allocations/{allocation_gid}', 'DELETE', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * 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. + * @param {<&vendorExtensions.x-jsdoc-type>} allocation_gid Globally unique identifier for the allocation. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmptyResponseData} + */ + deleteAllocation(allocation_gid) { + + return this.deleteAllocationWithHttpInfo(allocation_gid) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get an allocation + * Returns the complete allocation record for a single allocation. + * @param {String} allocation_gid Globally unique identifier for the allocation. + * @param {Object} opts Optional parameters + * @param {Array.} opts.opt_fields 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. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response + */ + getAllocationWithHttpInfo(allocation_gid, opts) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'allocation_gid' is set + if (allocation_gid === undefined || allocation_gid === null) { + throw new Error("Missing the required parameter 'allocation_gid' when calling getAllocation"); + } + + let pathParams = { + 'allocation_gid': allocation_gid + }; + let queryParams = {}; + opts = opts || {}; + queryParams = opts; + + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['personalAccessToken']; + let contentTypes = []; + let accepts = ['application/json; charset=UTF-8']; + let returnType = 'Blob'; + + return this.apiClient.callApi( + '/allocations/{allocation_gid}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * Get an allocation + * Returns the complete allocation record for a single allocation. + * @param {<&vendorExtensions.x-jsdoc-type>} allocation_gid Globally unique identifier for the allocation. + * @param {Object} opts Optional parameters + * @param {Array.} opts.opt_fields 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. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AllocationResponseData} + */ + getAllocation(allocation_gid, opts) { + + return this.getAllocationWithHttpInfo(allocation_gid, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get multiple allocations + * Returns a list of allocations filtered to a specific project or user. + * @param {Object} opts Optional parameters + * @param {String} opts.parent Globally unique identifier for the project to filter allocations by. + * @param {String} opts.assignee Globally unique identifier for the user the allocation is assigned to. + * @param {String} opts.workspace Globally unique identifier for the workspace. + * @param {Number} opts.limit Results per page. The number of objects to return per page. The value must be between 1 and 100. + * @param {String} opts.offset 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. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' + * @param {Array.} opts.opt_fields 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. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response + */ + getAllocationsWithHttpInfo(opts) { + opts = opts || {}; + let postBody = null; + + let pathParams = { + + }; + let queryParams = {}; + opts = opts || {}; + queryParams = opts; + + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['personalAccessToken']; + let contentTypes = []; + let accepts = ['application/json; charset=UTF-8']; + let returnType = 'Blob'; + // Check if RETURN_COLLECTION is set and return a collection object if it is + if (this.apiClient.RETURN_COLLECTION) { + return Collection.fromApiClient( + this.apiClient.callApi( + '/allocations', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ), + this.apiClient, + { + 'path': '/allocations', + 'httpMethod': 'GET', + 'pathParams': pathParams, + 'queryParams': queryParams, + 'headerParams': headerParams, + 'formParams': formParams, + 'bodyParam': postBody, + 'authNames': authNames, + 'contentTypes': contentTypes, + 'accepts': accepts, + 'returnType': returnType + } + ) + } + + return this.apiClient.callApi( + '/allocations', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * Get multiple allocations + * Returns a list of allocations filtered to a specific project or user. + * @param {Object} opts Optional parameters + * @param {String} opts.parent Globally unique identifier for the project to filter allocations by. + * @param {String} opts.assignee Globally unique identifier for the user the allocation is assigned to. + * @param {String} opts.workspace Globally unique identifier for the workspace. + * @param {Number} opts.limit Results per page. The number of objects to return per page. The value must be between 1 and 100. + * @param {String} opts.offset 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. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' + * @param {Array.} opts.opt_fields 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. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AllocationResponseArray} + */ + getAllocations(opts) { + // Check if RETURN_COLLECTION is set and return a collection object if it is + if (this.apiClient.RETURN_COLLECTION) { + return this.getAllocationsWithHttpInfo(opts) + } + + return this.getAllocationsWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * 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. + * @param {module:model/Object} body The updated fields for the allocation. + * @param {String} allocation_gid Globally unique identifier for the allocation. + * @param {Object} opts Optional parameters + * @param {Array.} opts.opt_fields 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. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response + */ + updateAllocationWithHttpInfo(body, allocation_gid, opts) { + opts = opts || {}; + let postBody = body; + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling updateAllocation"); + } + // verify the required parameter 'allocation_gid' is set + if (allocation_gid === undefined || allocation_gid === null) { + throw new Error("Missing the required parameter 'allocation_gid' when calling updateAllocation"); + } + + let pathParams = { + 'allocation_gid': allocation_gid + }; + let queryParams = {}; + opts = opts || {}; + queryParams = opts; + + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['personalAccessToken']; + let contentTypes = ['application/json; charset=UTF-8']; + let accepts = ['application/json; charset=UTF-8']; + let returnType = 'Blob'; + + return this.apiClient.callApi( + '/allocations/{allocation_gid}', 'PUT', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * 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. + * @param {<&vendorExtensions.x-jsdoc-type>} body The updated fields for the allocation. + * @param {<&vendorExtensions.x-jsdoc-type>} allocation_gid Globally unique identifier for the allocation. + * @param {Object} opts Optional parameters + * @param {Array.} opts.opt_fields 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. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AllocationResponseData} + */ + updateAllocation(body, allocation_gid, opts) { + + return this.updateAllocationWithHttpInfo(body, allocation_gid, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + +} diff --git a/src/api/AttachmentsApi.js b/src/api/AttachmentsApi.js index 8978a017..47792b2c 100644 --- a/src/api/AttachmentsApi.js +++ b/src/api/AttachmentsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Attachments service. * @module api/AttachmentsApi -* @version 3.0.3 +* @version 3.0.4 */ export class AttachmentsApi { diff --git a/src/api/AuditLogAPIApi.js b/src/api/AuditLogAPIApi.js index 638a9296..8c604d5f 100644 --- a/src/api/AuditLogAPIApi.js +++ b/src/api/AuditLogAPIApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * AuditLogAPI service. * @module api/AuditLogAPIApi -* @version 3.0.3 +* @version 3.0.4 */ export class AuditLogAPIApi { diff --git a/src/api/BatchAPIApi.js b/src/api/BatchAPIApi.js index 8049004b..cde8e18e 100644 --- a/src/api/BatchAPIApi.js +++ b/src/api/BatchAPIApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * BatchAPI service. * @module api/BatchAPIApi -* @version 3.0.3 +* @version 3.0.4 */ export class BatchAPIApi { diff --git a/src/api/CustomFieldSettingsApi.js b/src/api/CustomFieldSettingsApi.js index 512deed9..09434751 100644 --- a/src/api/CustomFieldSettingsApi.js +++ b/src/api/CustomFieldSettingsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * CustomFieldSettings service. * @module api/CustomFieldSettingsApi -* @version 3.0.3 +* @version 3.0.4 */ export class CustomFieldSettingsApi { diff --git a/src/api/CustomFieldsApi.js b/src/api/CustomFieldsApi.js index 502ba8b5..451dc799 100644 --- a/src/api/CustomFieldsApi.js +++ b/src/api/CustomFieldsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * CustomFields service. * @module api/CustomFieldsApi -* @version 3.0.3 +* @version 3.0.4 */ export class CustomFieldsApi { diff --git a/src/api/EventsApi.js b/src/api/EventsApi.js index 3589f926..9b589e85 100644 --- a/src/api/EventsApi.js +++ b/src/api/EventsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Events service. * @module api/EventsApi -* @version 3.0.3 +* @version 3.0.4 */ export class EventsApi { diff --git a/src/api/GoalRelationshipsApi.js b/src/api/GoalRelationshipsApi.js index e8a7780e..77daaf39 100644 --- a/src/api/GoalRelationshipsApi.js +++ b/src/api/GoalRelationshipsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * GoalRelationships service. * @module api/GoalRelationshipsApi -* @version 3.0.3 +* @version 3.0.4 */ export class GoalRelationshipsApi { diff --git a/src/api/GoalsApi.js b/src/api/GoalsApi.js index 851a781d..a4c1c90e 100644 --- a/src/api/GoalsApi.js +++ b/src/api/GoalsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Goals service. * @module api/GoalsApi -* @version 3.0.3 +* @version 3.0.4 */ export class GoalsApi { diff --git a/src/api/JobsApi.js b/src/api/JobsApi.js index 5098b045..ba17fa9b 100644 --- a/src/api/JobsApi.js +++ b/src/api/JobsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Jobs service. * @module api/JobsApi -* @version 3.0.3 +* @version 3.0.4 */ export class JobsApi { diff --git a/src/api/MembershipsApi.js b/src/api/MembershipsApi.js index c381c01a..1425411c 100644 --- a/src/api/MembershipsApi.js +++ b/src/api/MembershipsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Memberships service. * @module api/MembershipsApi -* @version 3.0.3 +* @version 3.0.4 */ export class MembershipsApi { diff --git a/src/api/OrganizationExportsApi.js b/src/api/OrganizationExportsApi.js index 06e9201a..7599a999 100644 --- a/src/api/OrganizationExportsApi.js +++ b/src/api/OrganizationExportsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * OrganizationExports service. * @module api/OrganizationExportsApi -* @version 3.0.3 +* @version 3.0.4 */ export class OrganizationExportsApi { diff --git a/src/api/PortfolioMembershipsApi.js b/src/api/PortfolioMembershipsApi.js index ae289619..433744da 100644 --- a/src/api/PortfolioMembershipsApi.js +++ b/src/api/PortfolioMembershipsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * PortfolioMemberships service. * @module api/PortfolioMembershipsApi -* @version 3.0.3 +* @version 3.0.4 */ export class PortfolioMembershipsApi { diff --git a/src/api/PortfoliosApi.js b/src/api/PortfoliosApi.js index 5a34d667..fd2c227a 100644 --- a/src/api/PortfoliosApi.js +++ b/src/api/PortfoliosApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Portfolios service. * @module api/PortfoliosApi -* @version 3.0.3 +* @version 3.0.4 */ export class PortfoliosApi { diff --git a/src/api/ProjectBriefsApi.js b/src/api/ProjectBriefsApi.js index 26d9a442..2c8233b4 100644 --- a/src/api/ProjectBriefsApi.js +++ b/src/api/ProjectBriefsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * ProjectBriefs service. * @module api/ProjectBriefsApi -* @version 3.0.3 +* @version 3.0.4 */ export class ProjectBriefsApi { diff --git a/src/api/ProjectMembershipsApi.js b/src/api/ProjectMembershipsApi.js index 412814d1..e1365c01 100644 --- a/src/api/ProjectMembershipsApi.js +++ b/src/api/ProjectMembershipsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * ProjectMemberships service. * @module api/ProjectMembershipsApi -* @version 3.0.3 +* @version 3.0.4 */ export class ProjectMembershipsApi { diff --git a/src/api/ProjectStatusesApi.js b/src/api/ProjectStatusesApi.js index ccfa1385..eeedbacc 100644 --- a/src/api/ProjectStatusesApi.js +++ b/src/api/ProjectStatusesApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * ProjectStatuses service. * @module api/ProjectStatusesApi -* @version 3.0.3 +* @version 3.0.4 */ export class ProjectStatusesApi { diff --git a/src/api/ProjectTemplatesApi.js b/src/api/ProjectTemplatesApi.js index dcc398dc..df985b5a 100644 --- a/src/api/ProjectTemplatesApi.js +++ b/src/api/ProjectTemplatesApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * ProjectTemplates service. * @module api/ProjectTemplatesApi -* @version 3.0.3 +* @version 3.0.4 */ export class ProjectTemplatesApi { diff --git a/src/api/ProjectsApi.js b/src/api/ProjectsApi.js index 1fa14255..611d85e5 100644 --- a/src/api/ProjectsApi.js +++ b/src/api/ProjectsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Projects service. * @module api/ProjectsApi -* @version 3.0.3 +* @version 3.0.4 */ export class ProjectsApi { diff --git a/src/api/RulesApi.js b/src/api/RulesApi.js index dfe7bdd2..2235f783 100644 --- a/src/api/RulesApi.js +++ b/src/api/RulesApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Rules service. * @module api/RulesApi -* @version 3.0.3 +* @version 3.0.4 */ export class RulesApi { diff --git a/src/api/SectionsApi.js b/src/api/SectionsApi.js index 4bc4c34e..12804432 100644 --- a/src/api/SectionsApi.js +++ b/src/api/SectionsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Sections service. * @module api/SectionsApi -* @version 3.0.3 +* @version 3.0.4 */ export class SectionsApi { diff --git a/src/api/StatusUpdatesApi.js b/src/api/StatusUpdatesApi.js index a766080f..4793d84e 100644 --- a/src/api/StatusUpdatesApi.js +++ b/src/api/StatusUpdatesApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * StatusUpdates service. * @module api/StatusUpdatesApi -* @version 3.0.3 +* @version 3.0.4 */ export class StatusUpdatesApi { diff --git a/src/api/StoriesApi.js b/src/api/StoriesApi.js index e3e02a1d..c30f81de 100644 --- a/src/api/StoriesApi.js +++ b/src/api/StoriesApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Stories service. * @module api/StoriesApi -* @version 3.0.3 +* @version 3.0.4 */ export class StoriesApi { diff --git a/src/api/TagsApi.js b/src/api/TagsApi.js index 9cd19c1e..446801e0 100644 --- a/src/api/TagsApi.js +++ b/src/api/TagsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Tags service. * @module api/TagsApi -* @version 3.0.3 +* @version 3.0.4 */ export class TagsApi { diff --git a/src/api/TaskTemplatesApi.js b/src/api/TaskTemplatesApi.js index 10c4aa48..e3ebae6a 100644 --- a/src/api/TaskTemplatesApi.js +++ b/src/api/TaskTemplatesApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * TaskTemplates service. * @module api/TaskTemplatesApi -* @version 3.0.3 +* @version 3.0.4 */ export class TaskTemplatesApi { diff --git a/src/api/TasksApi.js b/src/api/TasksApi.js index 2cdd5f90..75091f00 100644 --- a/src/api/TasksApi.js +++ b/src/api/TasksApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Tasks service. * @module api/TasksApi -* @version 3.0.3 +* @version 3.0.4 */ export class TasksApi { diff --git a/src/api/TeamMembershipsApi.js b/src/api/TeamMembershipsApi.js index 7d898266..2b98003b 100644 --- a/src/api/TeamMembershipsApi.js +++ b/src/api/TeamMembershipsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * TeamMemberships service. * @module api/TeamMembershipsApi -* @version 3.0.3 +* @version 3.0.4 */ export class TeamMembershipsApi { diff --git a/src/api/TeamsApi.js b/src/api/TeamsApi.js index 81a5387b..fc42b1d3 100644 --- a/src/api/TeamsApi.js +++ b/src/api/TeamsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Teams service. * @module api/TeamsApi -* @version 3.0.3 +* @version 3.0.4 */ export class TeamsApi { diff --git a/src/api/TimePeriodsApi.js b/src/api/TimePeriodsApi.js index 083905f2..11806434 100644 --- a/src/api/TimePeriodsApi.js +++ b/src/api/TimePeriodsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * TimePeriods service. * @module api/TimePeriodsApi -* @version 3.0.3 +* @version 3.0.4 */ export class TimePeriodsApi { diff --git a/src/api/TimeTrackingEntriesApi.js b/src/api/TimeTrackingEntriesApi.js index 3f01789b..0cacfc0d 100644 --- a/src/api/TimeTrackingEntriesApi.js +++ b/src/api/TimeTrackingEntriesApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * TimeTrackingEntries service. * @module api/TimeTrackingEntriesApi -* @version 3.0.3 +* @version 3.0.4 */ export class TimeTrackingEntriesApi { diff --git a/src/api/TypeaheadApi.js b/src/api/TypeaheadApi.js index 268a6bb7..cad034d0 100644 --- a/src/api/TypeaheadApi.js +++ b/src/api/TypeaheadApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Typeahead service. * @module api/TypeaheadApi -* @version 3.0.3 +* @version 3.0.4 */ export class TypeaheadApi { diff --git a/src/api/UserTaskListsApi.js b/src/api/UserTaskListsApi.js index e86de3f2..4d504688 100644 --- a/src/api/UserTaskListsApi.js +++ b/src/api/UserTaskListsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * UserTaskLists service. * @module api/UserTaskListsApi -* @version 3.0.3 +* @version 3.0.4 */ export class UserTaskListsApi { diff --git a/src/api/UsersApi.js b/src/api/UsersApi.js index d1a9b2cb..c55fb957 100644 --- a/src/api/UsersApi.js +++ b/src/api/UsersApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Users service. * @module api/UsersApi -* @version 3.0.3 +* @version 3.0.4 */ export class UsersApi { diff --git a/src/api/WebhooksApi.js b/src/api/WebhooksApi.js index 4f976dba..be5f8364 100644 --- a/src/api/WebhooksApi.js +++ b/src/api/WebhooksApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Webhooks service. * @module api/WebhooksApi -* @version 3.0.3 +* @version 3.0.4 */ export class WebhooksApi { diff --git a/src/api/WorkspaceMembershipsApi.js b/src/api/WorkspaceMembershipsApi.js index 6566b0ed..0a95cea5 100644 --- a/src/api/WorkspaceMembershipsApi.js +++ b/src/api/WorkspaceMembershipsApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * WorkspaceMemberships service. * @module api/WorkspaceMembershipsApi -* @version 3.0.3 +* @version 3.0.4 */ export class WorkspaceMembershipsApi { diff --git a/src/api/WorkspacesApi.js b/src/api/WorkspacesApi.js index 8eb1a711..95fd6784 100644 --- a/src/api/WorkspacesApi.js +++ b/src/api/WorkspacesApi.js @@ -18,7 +18,7 @@ var Collection = require('../utils/collection'); /** * Workspaces service. * @module api/WorkspacesApi -* @version 3.0.3 +* @version 3.0.4 */ export class WorkspacesApi { diff --git a/src/index.js b/src/index.js index 34e84f9f..84f67296 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,7 @@ * */ import {ApiClient} from './ApiClient'; +import {AllocationsApi} from './api/AllocationsApi'; import {AttachmentsApi} from './api/AttachmentsApi'; import {AuditLogAPIApi} from './api/AuditLogAPIApi'; import {BatchAPIApi} from './api/BatchAPIApi'; @@ -78,7 +79,7 @@ import {WorkspacesApi} from './api/WorkspacesApi'; * *

* @module index -* @version 3.0.3 +* @version 3.0.4 */ export { /** @@ -89,6 +90,12 @@ export { , + /** + * The AllocationsApi service constructor. + * @property {module:api/AllocationsApi} + */ + AllocationsApi, + /** * The AttachmentsApi service constructor. * @property {module:api/AttachmentsApi} diff --git a/test/api/AllocationsApi.spec.js b/test/api/AllocationsApi.spec.js new file mode 100644 index 00000000..690c435f --- /dev/null +++ b/test/api/AllocationsApi.spec.js @@ -0,0 +1,134 @@ +/* + * Asana + * This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml). + * + * OpenAPI spec version: 1.0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.54 + * + * Do not edit the class manually. + * + */ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.Asana); + } +}(this, function(expect, Asana) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new Asana.AllocationsApi(); + }); + + describe('(package)', function() { + describe('AllocationsApi', function() { + describe('createAllocation', function() { + it('should call createAllocation successfully', function(done) { + // TODO: uncomment, update parameter values for createAllocation call and complete the assertions + /* + var opts = {}; + + instance.createAllocation(body, opts).then(function(data) { + // TODO: update response assertions + expect(data).to.be.a(Asana.AllocationResponseData); + + done(); + }, function(error) { + done(error); + }); + */ + // TODO: uncomment and complete method invocation above, then delete this line and the next: + done(); + }); + }); + describe('deleteAllocation', function() { + it('should call deleteAllocation successfully', function(done) { + // TODO: uncomment, update parameter values for deleteAllocation call and complete the assertions + /* + + instance.deleteAllocation(allocation_gid).then(function(data) { + // TODO: update response assertions + expect(data).to.be.a(Asana.EmptyResponseData); + + done(); + }, function(error) { + done(error); + }); + */ + // TODO: uncomment and complete method invocation above, then delete this line and the next: + done(); + }); + }); + describe('getAllocation', function() { + it('should call getAllocation successfully', function(done) { + // TODO: uncomment, update parameter values for getAllocation call and complete the assertions + /* + var opts = {}; + + instance.getAllocation(allocation_gid, opts).then(function(data) { + // TODO: update response assertions + expect(data).to.be.a(Asana.AllocationResponseData); + + done(); + }, function(error) { + done(error); + }); + */ + // TODO: uncomment and complete method invocation above, then delete this line and the next: + done(); + }); + }); + describe('getAllocations', function() { + it('should call getAllocations successfully', function(done) { + // TODO: uncomment, update parameter values for getAllocations call and complete the assertions + /* + var opts = {}; + + instance.getAllocations(opts).then(function(data) { + // TODO: update response assertions + expect(data).to.be.a(Asana.AllocationResponseArray); + + done(); + }, function(error) { + done(error); + }); + */ + // TODO: uncomment and complete method invocation above, then delete this line and the next: + done(); + }); + }); + describe('updateAllocation', function() { + it('should call updateAllocation successfully', function(done) { + // TODO: uncomment, update parameter values for updateAllocation call and complete the assertions + /* + var opts = {}; + + instance.updateAllocation(body, allocation_gid, opts).then(function(data) { + // TODO: update response assertions + expect(data).to.be.a(Asana.AllocationResponseData); + + done(); + }, function(error) { + done(error); + }); + */ + // TODO: uncomment and complete method invocation above, then delete this line and the next: + done(); + }); + }); + }); + }); + +}));