-
Notifications
You must be signed in to change notification settings - Fork 74
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 #253 from Asana/openapi-sync
Generated from OpenAPI
- Loading branch information
Showing
7 changed files
with
178 additions
and
3 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.12 | ||
0.18.13 |
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,101 @@ | ||
/** | ||
* 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 ProjectTemplates(dispatcher) { | ||
Resource.call(this, dispatcher); | ||
} | ||
util.inherits(ProjectTemplates, Resource); | ||
|
||
|
||
/** | ||
* Get a project template | ||
* @param {String} projectTemplateGid: (required) Globally unique identifier for the project template. | ||
* @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 | ||
*/ | ||
ProjectTemplates.prototype.getProjectTemplate = function( | ||
projectTemplateGid, | ||
params, | ||
dispatchOptions | ||
) { | ||
var path = "/project_templates/{project_template_gid}".replace("{project_template_gid}", projectTemplateGid); | ||
|
||
return this.dispatchGet(path, params, dispatchOptions) | ||
}; | ||
|
||
|
||
/** | ||
* Get multiple project templates | ||
* @param {Object} params: Parameters for the request | ||
- workspace {String}: The workspace to filter results on. | ||
- team {String}: The team to filter projects on. | ||
- 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 | ||
*/ | ||
ProjectTemplates.prototype.getProjectTemplates = function( | ||
params, | ||
dispatchOptions | ||
) { | ||
var path = "/project_templates"; | ||
|
||
return this.dispatchGetCollection(path, params, dispatchOptions) | ||
}; | ||
|
||
|
||
/** | ||
* Get a team's project templates | ||
* @param {String} teamGid: (required) Globally unique identifier for the team. | ||
* @param {Object} params: Parameters for the request | ||
- 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 | ||
*/ | ||
ProjectTemplates.prototype.getProjectTemplatesForTeam = function( | ||
teamGid, | ||
params, | ||
dispatchOptions | ||
) { | ||
var path = "/teams/{team_gid}/project_templates".replace("{team_gid}", teamGid); | ||
|
||
return this.dispatchGetCollection(path, params, dispatchOptions) | ||
}; | ||
|
||
|
||
/** | ||
* Instantiate a project from a project template | ||
* @param {String} projectTemplateGid: (required) Globally unique identifier for the project template. | ||
* @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 | ||
*/ | ||
ProjectTemplates.prototype.instantiateProject = function( | ||
projectTemplateGid, | ||
data, | ||
dispatchOptions | ||
) { | ||
var path = "/project_templates/{project_template_gid}/instantiateProject".replace("{project_template_gid}", projectTemplateGid); | ||
|
||
return this.dispatchPost(path, data, dispatchOptions) | ||
}; | ||
|
||
module.exports = ProjectTemplates; | ||
/* 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
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 @@ | ||
projecttemplates: | ||
getProjectTemplate: >- | ||
const asana = require('asana'); | ||
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); | ||
client.projecttemplates.getProjectTemplate(projectTemplateGid, {param: "value", param: "value", opt_pretty: true}) | ||
.then((result) => { | ||
console.log(result); | ||
}); | ||
getProjectTemplates: >- | ||
const asana = require('asana'); | ||
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); | ||
client.projecttemplates.getProjectTemplates({param: "value", param: "value", opt_pretty: true}) | ||
.then((result) => { | ||
console.log(result); | ||
}); | ||
getProjectTemplatesForTeam: >- | ||
const asana = require('asana'); | ||
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); | ||
client.projecttemplates.getProjectTemplatesForTeam(teamGid, {param: "value", param: "value", opt_pretty: true}) | ||
.then((result) => { | ||
console.log(result); | ||
}); | ||
instantiateProject: >- | ||
const asana = require('asana'); | ||
const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); | ||
client.projecttemplates.instantiateProject(projectTemplateGid, {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