Skip to content

Commit

Permalink
Merge pull request #249 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Generated from OpenAPI
  • Loading branch information
aw-asana authored Jan 26, 2022
2 parents 6bf00fb + 0dff34f commit 2837a70
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.18.11
0.18.12
93 changes: 93 additions & 0 deletions lib/resources/gen/project_briefs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* This file is auto-generated by our openapi spec.
* We try to keep the generated code pretty clean but there will be lint
* errors that are just not worth fixing (like unused requires).
* TODO: maybe we can just disable those specifically and keep this code
* pretty lint-free too!
*/
/* jshint ignore:start */
var Resource = require('../resource');
var util = require('util');
var _ = require('lodash');

function ProjectBriefs(dispatcher) {
Resource.call(this, dispatcher);
}
util.inherits(ProjectBriefs, Resource);


/**
* Create a project brief
* @param {String} projectGid: (required) Globally unique identifier for the project.
* @param {Object} data: Data for the request
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
ProjectBriefs.prototype.createProjectBrief = function(
projectGid,
data,
dispatchOptions
) {
var path = "/projects/{project_gid}/project_briefs".replace("{project_gid}", projectGid);

return this.dispatchPost(path, data, dispatchOptions)
};


/**
* Delete a project brief
* @param {String} projectBriefGid: (required) Globally unique identifier for the project brief.
* @param {Object} data: Data for the request
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
ProjectBriefs.prototype.deleteProjectBrief = function(
projectBriefGid,
data,
dispatchOptions
) {
var path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid);

return this.dispatchDelete(path, data, dispatchOptions)
};


/**
* Get a project brief
* @param {String} projectBriefGid: (required) Globally unique identifier for the project brief.
* @param {Object} params: Parameters for the request
- optFields {[String]}: Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
- optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
ProjectBriefs.prototype.getProjectBrief = function(
projectBriefGid,
params,
dispatchOptions
) {
var path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid);

return this.dispatchGet(path, params, dispatchOptions)
};


/**
* Update a project brief
* @param {String} projectBriefGid: (required) Globally unique identifier for the project brief.
* @param {Object} data: Data for the request
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
ProjectBriefs.prototype.updateProjectBrief = function(
projectBriefGid,
data,
dispatchOptions
) {
var path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid);

return this.dispatchPut(path, data, dispatchOptions)
};

module.exports = ProjectBriefs;
/* jshint ignore:end */
95 changes: 95 additions & 0 deletions lib/resources/gen/status_updates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* This file is auto-generated by our openapi spec.
* We try to keep the generated code pretty clean but there will be lint
* errors that are just not worth fixing (like unused requires).
* TODO: maybe we can just disable those specifically and keep this code
* pretty lint-free too!
*/
/* jshint ignore:start */
var Resource = require('../resource');
var util = require('util');
var _ = require('lodash');

function StatusUpdates(dispatcher) {
Resource.call(this, dispatcher);
}
util.inherits(StatusUpdates, Resource);


/**
* Create a status update
* @param {Object} data: Data for the request
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
StatusUpdates.prototype.createStatusForObject = function(
data,
dispatchOptions
) {
var path = "/status_updates";

return this.dispatchPost(path, data, dispatchOptions)
};


/**
* Delete a status update
* @param {String} statusGid: (required) The status update to get.
* @param {Object} data: Data for the request
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
StatusUpdates.prototype.deleteStatus = function(
statusGid,
data,
dispatchOptions
) {
var path = "/status_updates/{status_gid}".replace("{status_gid}", statusGid);

return this.dispatchDelete(path, data, dispatchOptions)
};


/**
* Get a status update
* @param {String} statusGid: (required) The status update to get.
* @param {Object} params: Parameters for the request
- optFields {[String]}: Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
- optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
StatusUpdates.prototype.getStatus = function(
statusGid,
params,
dispatchOptions
) {
var path = "/status_updates/{status_gid}".replace("{status_gid}", statusGid);

return this.dispatchGet(path, params, dispatchOptions)
};


/**
* Get status updates from an object
* @param {Object} params: Parameters for the request
- parent {String}: (required) Globally unique identifier for object to fetch statuses from.
- createdSince {Date}: Only return statuses that have been created since the given time.
- 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.'
- limit {Number}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
- optFields {[String]}: Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
- optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
StatusUpdates.prototype.getStatusesForObject = function(
params,
dispatchOptions
) {
var path = "/status_updates";

return this.dispatchGetCollection(path, params, dispatchOptions)
};

module.exports = StatusUpdates;
/* jshint ignore:end */
3 changes: 0 additions & 3 deletions lib/resources/gen/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,12 @@ Tasks.prototype.removeTagForTask = function(
- tagsNot {String}: Comma-separated list of tag IDs
- tagsAll {String}: Comma-separated list of tag IDs
- teamsAny {String}: Comma-separated list of team IDs
- followersAny {String}: Comma-separated list of user identifiers
- followersNot {String}: Comma-separated list of user identifiers
- createdByAny {String}: Comma-separated list of user identifiers
- createdByNot {String}: Comma-separated list of user identifiers
- assignedByAny {String}: Comma-separated list of user identifiers
- assignedByNot {String}: Comma-separated list of user identifiers
- likedByAny {String}: Comma-separated list of user identifiers
- likedByNot {String}: Comma-separated list of user identifiers
- commentedOnByAny {String}: Comma-separated list of user identifiers
- commentedOnByNot {String}: Comma-separated list of user identifiers
- dueOnBefore {Date}: ISO 8601 date string
- dueOnAfter {Date}: ISO 8601 date string
Expand Down
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": "0.18.11",
"version": "0.18.12",
"description": "Official NodeJS and BrowserJS client for the Asana API",
"main": "index.js",
"scripts": {
Expand Down
45 changes: 45 additions & 0 deletions samples/project_briefs_sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
projectbriefs:
createProjectBrief: >-
const asana = require('asana');
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');
client.projectbriefs.createProjectBrief(projectGid, {field: "value", field: "value", pretty: true})
.then((result) => {
console.log(result);
});
deleteProjectBrief: >-
const asana = require('asana');
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');
client.projectbriefs.deleteProjectBrief(projectBriefGid)
.then((result) => {
console.log(result);
});
getProjectBrief: >-
const asana = require('asana');
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');
client.projectbriefs.getProjectBrief(projectBriefGid, {param: "value", param: "value", opt_pretty: true})
.then((result) => {
console.log(result);
});
updateProjectBrief: >-
const asana = require('asana');
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');
client.projectbriefs.updateProjectBrief(projectBriefGid, {field: "value", field: "value", pretty: true})
.then((result) => {
console.log(result);
});
45 changes: 45 additions & 0 deletions samples/status_updates_sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
statusupdates:
createStatusForObject: >-
const asana = require('asana');
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');
client.statusupdates.createStatusForObject({field: "value", field: "value", pretty: true})
.then((result) => {
console.log(result);
});
deleteStatus: >-
const asana = require('asana');
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');
client.statusupdates.deleteStatus(statusGid)
.then((result) => {
console.log(result);
});
getStatus: >-
const asana = require('asana');
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');
client.statusupdates.getStatus(statusGid, {param: "value", param: "value", opt_pretty: true})
.then((result) => {
console.log(result);
});
getStatusesForObject: >-
const asana = require('asana');
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');
client.statusupdates.getStatusesForObject({param: "value", param: "value", opt_pretty: true})
.then((result) => {
console.log(result);
});

0 comments on commit 2837a70

Please sign in to comment.