-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from Asana/openapi-sync
Generated from OpenAPI
- Loading branch information
Showing
7 changed files
with
280 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.18.11 | ||
0.18.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |