diff --git a/lib/resources/gen/attachments.js b/lib/resources/gen/attachments.js index 956e1552..792ed074 100644 --- a/lib/resources/gen/attachments.js +++ b/lib/resources/gen/attachments.js @@ -55,9 +55,9 @@ Attachments.prototype.getAttachment = function( /** - * Get attachments for a task - * @param {String} taskGid: (required) The task to operate on. + * Get attachments from an object * @param {Object} params: Parameters for the request + - parent {String}: (required) Globally unique identifier for object to fetch statuses from. Must be a GID for a task or project_brief. - 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. @@ -65,12 +65,11 @@ Attachments.prototype.getAttachment = function( * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource */ -Attachments.prototype.getAttachmentsForTask = function( - taskGid, +Attachments.prototype.getAttachmentsForObject = function( params, dispatchOptions ) { - var path = "/tasks/{task_gid}/attachments".replace("{task_gid}", taskGid); + var path = "/attachments"; return this.dispatchGetCollection(path, params, dispatchOptions) }; diff --git a/lib/resources/gen/goals.js b/lib/resources/gen/goals.js index d87405e1..0551e77c 100644 --- a/lib/resources/gen/goals.js +++ b/lib/resources/gen/goals.js @@ -18,15 +18,17 @@ util.inherits(Goals, Resource); /** * Add a collaborator to a goal + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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 */ Goals.prototype.addFollowers = function( + goalGid, data, dispatchOptions ) { - var path = "/goals/{goal_gid}/addFollowers"; + var path = "/goals/{goal_gid}/addFollowers".replace("{goal_gid}", goalGid); return this.dispatchPost(path, data, dispatchOptions) }; @@ -34,15 +36,17 @@ Goals.prototype.addFollowers = function( /** * Add a subgoal to a parent goal + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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 */ Goals.prototype.addSubgoal = function( + goalGid, data, dispatchOptions ) { - var path = "/goals/{goal_gid}/addSubgoal"; + var path = "/goals/{goal_gid}/addSubgoal".replace("{goal_gid}", goalGid); return this.dispatchPost(path, data, dispatchOptions) }; @@ -50,15 +54,17 @@ Goals.prototype.addSubgoal = function( /** * Add a project/portfolio as supporting work for a goal. + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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 */ Goals.prototype.addSupportingWorkForGoal = function( + goalGid, data, dispatchOptions ) { - var path = "/goals/{goal_gid}/addSupportingWork"; + var path = "/goals/{goal_gid}/addSupportingWork".replace("{goal_gid}", goalGid); return this.dispatchPost(path, data, dispatchOptions) }; @@ -82,15 +88,17 @@ Goals.prototype.createGoal = function( /** * Create a goal metric + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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 */ Goals.prototype.createGoalMetric = function( + goalGid, data, dispatchOptions ) { - var path = "/goals/{goal_gid}/setMetric"; + var path = "/goals/{goal_gid}/setMetric".replace("{goal_gid}", goalGid); return this.dispatchPost(path, data, dispatchOptions) }; @@ -162,6 +170,7 @@ Goals.prototype.getGoals = function( /** * Get parent goals from a goal + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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. @@ -169,10 +178,11 @@ Goals.prototype.getGoals = function( * @return {Promise} The requested resource */ Goals.prototype.getParentGoalsForGoal = function( + goalGid, params, dispatchOptions ) { - var path = "/goals/{goal_gid}/parentGoals"; + var path = "/goals/{goal_gid}/parentGoals".replace("{goal_gid}", goalGid); return this.dispatchGetCollection(path, params, dispatchOptions) }; @@ -180,6 +190,7 @@ Goals.prototype.getParentGoalsForGoal = function( /** * Get subgoals from a goal + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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. @@ -187,10 +198,11 @@ Goals.prototype.getParentGoalsForGoal = function( * @return {Promise} The requested resource */ Goals.prototype.getSubgoalsForGoal = function( + goalGid, params, dispatchOptions ) { - var path = "/goals/{goal_gid}/subgoals"; + var path = "/goals/{goal_gid}/subgoals".replace("{goal_gid}", goalGid); return this.dispatchGetCollection(path, params, dispatchOptions) }; @@ -198,15 +210,17 @@ Goals.prototype.getSubgoalsForGoal = function( /** * Remove a collaborator from a goal + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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 */ Goals.prototype.removeFollowers = function( + goalGid, data, dispatchOptions ) { - var path = "/goals/{goal_gid}/removeFollowers"; + var path = "/goals/{goal_gid}/removeFollowers".replace("{goal_gid}", goalGid); return this.dispatchPost(path, data, dispatchOptions) }; @@ -214,15 +228,17 @@ Goals.prototype.removeFollowers = function( /** * Remove a subgoal from a goal + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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 */ Goals.prototype.removeSubgoal = function( + goalGid, data, dispatchOptions ) { - var path = "/goals/{goal_gid}/removeSubgoal"; + var path = "/goals/{goal_gid}/removeSubgoal".replace("{goal_gid}", goalGid); return this.dispatchPost(path, data, dispatchOptions) }; @@ -230,15 +246,17 @@ Goals.prototype.removeSubgoal = function( /** * Remove a project/portfolio as supporting work for a goal. + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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 */ Goals.prototype.removeSupportingWorkForGoal = function( + goalGid, data, dispatchOptions ) { - var path = "/goals/{goal_gid}/removeSupportingWork"; + var path = "/goals/{goal_gid}/removeSupportingWork".replace("{goal_gid}", goalGid); return this.dispatchPost(path, data, dispatchOptions) }; @@ -246,6 +264,7 @@ Goals.prototype.removeSupportingWorkForGoal = function( /** * Get supporting work from a goal + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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. @@ -253,10 +272,11 @@ Goals.prototype.removeSupportingWorkForGoal = function( * @return {Promise} The requested resource */ Goals.prototype.supportingWork = function( + goalGid, params, dispatchOptions ) { - var path = "/goals/{goal_gid}/supportingWork"; + var path = "/goals/{goal_gid}/supportingWork".replace("{goal_gid}", goalGid); return this.dispatchGetCollection(path, params, dispatchOptions) }; @@ -282,15 +302,17 @@ Goals.prototype.updateGoal = function( /** * Update a goal metric + * @param {String} goalGid: (required) Globally unique identifier for the goal. * @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 */ Goals.prototype.updateGoalMetric = function( + goalGid, data, dispatchOptions ) { - var path = "/goals/{goal_gid}/setMetricCurrentValue"; + var path = "/goals/{goal_gid}/setMetricCurrentValue".replace("{goal_gid}", goalGid); return this.dispatchPost(path, data, dispatchOptions) }; diff --git a/lib/resources/gen/status_updates.js b/lib/resources/gen/status_updates.js index 5f526e84..763a11ac 100644 --- a/lib/resources/gen/status_updates.js +++ b/lib/resources/gen/status_updates.js @@ -73,7 +73,7 @@ StatusUpdates.prototype.getStatus = function( /** * 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. + - parent {String}: (required) Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal. - 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. diff --git a/lib/resources/gen/tasks.js b/lib/resources/gen/tasks.js index 94e00674..33911f44 100644 --- a/lib/resources/gen/tasks.js +++ b/lib/resources/gen/tasks.js @@ -265,7 +265,7 @@ Tasks.prototype.getTask = function( /** * Get multiple tasks * @param {Object} params: Parameters for the request - - assignee {String}: The assignee to filter tasks on. *Note: If you specify `assignee`, you must also specify the `workspace` to filter on.* + - assignee {String}: The assignee to filter tasks on. If searching for unassigned tasks, assignee.any = null can be specified. *Note: If you specify `assignee`, you must also specify the `workspace` to filter on.* - project {String}: The project to filter tasks on. - section {String}: The section to filter tasks on. *Note: Currently, this is only supported in board views.* - workspace {String}: The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.* @@ -292,6 +292,7 @@ Tasks.prototype.getTasks = function( * Get tasks from a project * @param {String} projectGid: (required) Globally unique identifier for the project. * @param {Object} params: Parameters for the request + - completedSince {String}: Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. - 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. diff --git a/lib/resources/gen/teams.js b/lib/resources/gen/teams.js index f90492d3..aa26db25 100644 --- a/lib/resources/gen/teams.js +++ b/lib/resources/gen/teams.js @@ -73,9 +73,10 @@ Teams.prototype.getTeam = function( /** - * Get teams in an organization - * @param {String} workspaceGid: (required) Globally unique identifier for the workspace or organization. + * Get teams for a user + * @param {String} userGid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. * @param {Object} params: Parameters for the request + - organization {String}: (required) The workspace or organization to filter teams 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. @@ -83,22 +84,21 @@ Teams.prototype.getTeam = function( * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource */ -Teams.prototype.getTeamsForOrganization = function( - workspaceGid, +Teams.prototype.getTeamsForUser = function( + userGid, params, dispatchOptions ) { - var path = "/organizations/{workspace_gid}/teams".replace("{workspace_gid}", workspaceGid); + var path = "/users/{user_gid}/teams".replace("{user_gid}", userGid); return this.dispatchGetCollection(path, params, dispatchOptions) }; /** - * Get teams for a user - * @param {String} userGid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + * Get teams in a workspace + * @param {String} workspaceGid: (required) Globally unique identifier for the workspace or organization. * @param {Object} params: Parameters for the request - - organization {String}: (required) The workspace or organization to filter teams 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. @@ -106,12 +106,12 @@ Teams.prototype.getTeamsForOrganization = function( * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource */ -Teams.prototype.getTeamsForUser = function( - userGid, +Teams.prototype.getTeamsForWorkspace = function( + workspaceGid, params, dispatchOptions ) { - var path = "/users/{user_gid}/teams".replace("{user_gid}", userGid); + var path = "/workspaces/{workspace_gid}/teams".replace("{workspace_gid}", workspaceGid); return this.dispatchGetCollection(path, params, dispatchOptions) }; diff --git a/samples/attachments_sample.yaml b/samples/attachments_sample.yaml index 5a95a337..a16bcb60 100644 --- a/samples/attachments_sample.yaml +++ b/samples/attachments_sample.yaml @@ -6,7 +6,7 @@ attachments: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.attachments.createAttachmentForTask(taskGid, {field: "value", field: "value", pretty: true}) + client.attachments.createAttachmentForTask({field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); @@ -32,14 +32,14 @@ attachments: .then((result) => { console.log(result); }); - getAttachmentsForTask: >- + getAttachmentsForObject: >- const asana = require('asana'); const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.attachments.getAttachmentsForTask(taskGid, {param: "value", param: "value", opt_pretty: true}) + client.attachments.getAttachmentsForObject({param: "value", param: "value", opt_pretty: true}) .then((result) => { console.log(result); }); diff --git a/samples/goals_sample.yaml b/samples/goals_sample.yaml index 519c0d99..e2ccdf5a 100644 --- a/samples/goals_sample.yaml +++ b/samples/goals_sample.yaml @@ -6,7 +6,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.addFollowers({field: "value", field: "value", pretty: true}) + client.goals.addFollowers(goalGid, {field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); @@ -17,7 +17,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.addSubgoal({field: "value", field: "value", pretty: true}) + client.goals.addSubgoal(goalGid, {field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); @@ -28,7 +28,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.addSupportingWorkForGoal({field: "value", field: "value", pretty: true}) + client.goals.addSupportingWorkForGoal(goalGid, {field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); @@ -50,7 +50,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.createGoalMetric({field: "value", field: "value", pretty: true}) + client.goals.createGoalMetric(goalGid, {field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); @@ -94,7 +94,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.getParentGoalsForGoal({param: "value", param: "value", opt_pretty: true}) + client.goals.getParentGoalsForGoal(goalGid, {param: "value", param: "value", opt_pretty: true}) .then((result) => { console.log(result); }); @@ -105,7 +105,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.getSubgoalsForGoal({param: "value", param: "value", opt_pretty: true}) + client.goals.getSubgoalsForGoal(goalGid, {param: "value", param: "value", opt_pretty: true}) .then((result) => { console.log(result); }); @@ -116,7 +116,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.removeFollowers({field: "value", field: "value", pretty: true}) + client.goals.removeFollowers(goalGid, {field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); @@ -127,7 +127,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.removeSubgoal({field: "value", field: "value", pretty: true}) + client.goals.removeSubgoal(goalGid, {field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); @@ -138,7 +138,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.removeSupportingWorkForGoal({field: "value", field: "value", pretty: true}) + client.goals.removeSupportingWorkForGoal(goalGid, {field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); @@ -149,7 +149,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.supportingWork({param: "value", param: "value", opt_pretty: true}) + client.goals.supportingWork(goalGid, {param: "value", param: "value", opt_pretty: true}) .then((result) => { console.log(result); }); @@ -171,7 +171,7 @@ goals: const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.goals.updateGoalMetric({field: "value", field: "value", pretty: true}) + client.goals.updateGoalMetric(goalGid, {field: "value", field: "value", pretty: true}) .then((result) => { console.log(result); }); diff --git a/samples/teams_sample.yaml b/samples/teams_sample.yaml index 0a7a2548..60002bc1 100644 --- a/samples/teams_sample.yaml +++ b/samples/teams_sample.yaml @@ -32,25 +32,25 @@ teams: .then((result) => { console.log(result); }); - getTeamsForOrganization: >- + getTeamsForUser: >- const asana = require('asana'); const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.teams.getTeamsForOrganization(workspaceGid, {param: "value", param: "value", opt_pretty: true}) + client.teams.getTeamsForUser(userGid, {param: "value", param: "value", opt_pretty: true}) .then((result) => { console.log(result); }); - getTeamsForUser: >- + getTeamsForWorkspace: >- const asana = require('asana'); const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN'); - client.teams.getTeamsForUser(userGid, {param: "value", param: "value", opt_pretty: true}) + client.teams.getTeamsForWorkspace(workspaceGid, {param: "value", param: "value", opt_pretty: true}) .then((result) => { console.log(result); });