import type { AddCustomFieldSettingRequest } from '../models/AddCustomFieldSettingRequest'; import type { AddFollowersRequest } from '../models/AddFollowersRequest'; import type { AddMembersRequest } from '../models/AddMembersRequest'; import type { CustomFieldSettingResponse } from '../models/CustomFieldSettingResponse'; import type { EmptyResponse } from '../models/EmptyResponse'; import type { JobCompact } from '../models/JobCompact'; import type { ProjectCompact } from '../models/ProjectCompact'; import type { ProjectDuplicateRequest } from '../models/ProjectDuplicateRequest'; import type { ProjectRequest } from '../models/ProjectRequest'; import type { ProjectResponse } from '../models/ProjectResponse'; import type { ProjectSaveAsTemplateRequest } from '../models/ProjectSaveAsTemplateRequest'; import type { RemoveCustomFieldSettingRequest } from '../models/RemoveCustomFieldSettingRequest'; import type { RemoveFollowersRequest } from '../models/RemoveFollowersRequest'; import type { RemoveMembersRequest } from '../models/RemoveMembersRequest'; import type { TaskCountResponse } from '../models/TaskCountResponse'; import type { CancelablePromise } from '../core/CancelablePromise'; import type { BaseHttpRequest } from '../core/BaseHttpRequest'; export declare class ProjectsService { readonly httpRequest: BaseHttpRequest; constructor(httpRequest: BaseHttpRequest); /** * Get multiple projects * Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned. * *Note: This endpoint may timeout for large domains. Try filtering by team!* * @returns any Successfully retrieved projects. * @throws ApiError */ getProjects({ optPretty, optFields, limit, offset, workspace, team, archived, }: { /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; /** * Results per page. * The number of objects to return per page. The value must be between 1 and 100. */ limit?: number; /** * 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.' */ offset?: string; /** * The workspace or organization to filter projects on. */ workspace?: string; /** * The team to filter projects on. */ team?: string; /** * Only return projects whose `archived` field takes on the value of this parameter. */ archived?: boolean; }): CancelablePromise<{ data?: Array; }>; /** * Create a project * Create a new project in a workspace or team. * * Every project is required to be created in a specific workspace or * organization, and this cannot be changed once set. Note that you can use * the `workspace` parameter regardless of whether or not it is an * organization. * * If the workspace for your project is an organization, you must also * supply a `team` to share the project with. * * Returns the full record of the newly created project. * @returns any Successfully retrieved projects. * @throws ApiError */ createProject({ requestBody, optPretty, optFields, }: { /** * The project to create. */ requestBody: { data?: ProjectRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Get a project * Returns the complete project record for a single project. * @returns any Successfully retrieved the requested project. * @throws ApiError */ getProject({ projectGid, optPretty, optFields, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Update a project * A specific, existing project can be updated by making a PUT request on * the URL for that project. Only the fields provided in the `data` block * will be updated; any unspecified fields will remain unchanged. * * When using this method, it is best to specify only those fields you wish * to change, or else you may overwrite changes made by another user since * you last retrieved the task. * * Returns the complete updated project record. * @returns any Successfully updated the project. * @throws ApiError */ updateProject({ projectGid, requestBody, optPretty, optFields, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * The updated fields for the project. */ requestBody: { data?: ProjectRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Delete a project * A specific, existing project can be deleted by making a DELETE request on * the URL for that project. * * Returns an empty data record. * @returns any Successfully deleted the specified project. * @throws ApiError */ deleteProject({ projectGid, optPretty, optFields, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: EmptyResponse; }>; /** * Duplicate a project * Creates and returns a job that will asynchronously handle the duplication. * @returns any Successfully created the job to handle duplication. * @throws ApiError */ duplicateProject({ projectGid, optPretty, optFields, requestBody, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; /** * Describes the duplicate's name and the elements that will be duplicated. */ requestBody?: { data?: ProjectDuplicateRequest; }; }): CancelablePromise<{ data?: JobCompact; }>; /** * Get projects a task is in * Returns a compact representation of all of the projects the task is in. * @returns any Successfully retrieved the projects for the given task. * @throws ApiError */ getProjectsForTask({ taskGid, optPretty, optFields, limit, offset, }: { /** * The task to operate on. */ taskGid: string; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; /** * Results per page. * The number of objects to return per page. The value must be between 1 and 100. */ limit?: number; /** * 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.' */ offset?: string; }): CancelablePromise<{ data?: Array; }>; /** * Get a team's projects * Returns the compact project records for all projects in the team. * @returns any Successfully retrieved the requested team's projects. * @throws ApiError */ getProjectsForTeam({ teamGid, optPretty, optFields, limit, offset, archived, }: { /** * Globally unique identifier for the team. */ teamGid: string; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; /** * Results per page. * The number of objects to return per page. The value must be between 1 and 100. */ limit?: number; /** * 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.' */ offset?: string; /** * Only return projects whose `archived` field takes on the value of this parameter. */ archived?: boolean; }): CancelablePromise<{ data?: Array; }>; /** * Create a project in a team * Creates a project shared with the given team. * * Returns the full record of the newly created project. * @returns any Successfully created the specified project. * @throws ApiError */ createProjectForTeam({ teamGid, requestBody, optPretty, optFields, }: { /** * Globally unique identifier for the team. */ teamGid: string; /** * The new project to create. */ requestBody: { data?: ProjectRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Get all projects in a workspace * Returns the compact project records for all projects in the workspace. * *Note: This endpoint may timeout for large domains. Prefer the `/teams/{team_gid}/projects` endpoint.* * @returns any Successfully retrieved the requested workspace's projects. * @throws ApiError */ getProjectsForWorkspace({ workspaceGid, optPretty, optFields, limit, offset, archived, }: { /** * Globally unique identifier for the workspace or organization. */ workspaceGid: string; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; /** * Results per page. * The number of objects to return per page. The value must be between 1 and 100. */ limit?: number; /** * 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.' */ offset?: string; /** * Only return projects whose `archived` field takes on the value of this parameter. */ archived?: boolean; }): CancelablePromise<{ data?: Array; }>; /** * Create a project in a workspace * Returns the compact project records for all projects in the workspace. * * If the workspace for your project is an organization, you must also * supply a team to share the project with. * * Returns the full record of the newly created project. * @returns any Successfully created a new project in the specified workspace. * @throws ApiError */ createProjectForWorkspace({ workspaceGid, requestBody, optPretty, optFields, }: { /** * Globally unique identifier for the workspace or organization. */ workspaceGid: string; /** * The new project to create. */ requestBody: { data?: ProjectRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Add a custom field to a project * Custom fields are associated with projects by way of custom field settings. This method creates a setting for the project. * @returns any Successfully added the custom field to the project. * @throws ApiError */ addCustomFieldSettingForProject({ projectGid, requestBody, optPretty, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * Information about the custom field setting. */ requestBody: { data?: AddCustomFieldSettingRequest; }; /** * 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. */ optPretty?: boolean; }): CancelablePromise<{ data?: CustomFieldSettingResponse; }>; /** * Remove a custom field from a project * Removes a custom field setting from a project. * @returns any Successfully removed the custom field from the project. * @throws ApiError */ removeCustomFieldSettingForProject({ projectGid, requestBody, optPretty, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * Information about the custom field setting being removed. */ requestBody: { data?: RemoveCustomFieldSettingRequest; }; /** * 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. */ optPretty?: boolean; }): CancelablePromise<{ data?: EmptyResponse; }>; /** * Get task count of a project * Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/input-output-options) using `opt_fields` to get any information from this endpoint. * * This endpoint has an additional [rate limit](/docs/standard-rate-limits) and each field counts especially high against our [cost limits](/docs/cost-limits). * * Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts. * @returns any Successfully retrieved the requested project's task counts. * @throws ApiError */ getTaskCountsForProject({ projectGid, optPretty, optFields, limit, offset, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; /** * Results per page. * The number of objects to return per page. The value must be between 1 and 100. */ limit?: number; /** * 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.' */ offset?: string; }): CancelablePromise<{ data?: TaskCountResponse; }>; /** * Add users to a project * Adds the specified list of users as members of the project. Note that a user being added as a member may also be added as a *follower* as a result of this operation. This is because the user's default notification settings (i.e., in the "Notifcations" tab of "My Profile Settings") will override this endpoint's default behavior of setting "Tasks added" notifications to `false`. * Returns the updated project record. * @returns any Successfully added members to the project. * @throws ApiError */ addMembersForProject({ projectGid, requestBody, optPretty, optFields, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * Information about the members being added. */ requestBody: { data?: AddMembersRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Remove users from a project * Removes the specified list of users from members of the project. * Returns the updated project record. * @returns any Successfully removed the members from the project. * @throws ApiError */ removeMembersForProject({ projectGid, requestBody, optPretty, optFields, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * Information about the members being removed. */ requestBody: { data?: RemoveMembersRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Add followers to a project * Adds the specified list of users as followers to the project. Followers are a subset of members who have opted in to receive "tasks added" notifications for a project. Therefore, if the users are not already members of the project, they will also become members as a result of this operation. * Returns the updated project record. * @returns any Successfully added followers to the project. * @throws ApiError */ addFollowersForProject({ projectGid, requestBody, optPretty, optFields, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * Information about the followers being added. */ requestBody: { data?: AddFollowersRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Remove followers from a project * Removes the specified list of users from following the project, this will not affect project membership status. * Returns the updated project record. * @returns any Successfully removed followers from the project. * @throws ApiError */ removeFollowersForProject({ projectGid, requestBody, optPretty, optFields, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * Information about the followers being removed. */ requestBody: { data?: RemoveFollowersRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: ProjectResponse; }>; /** * Create a project template from a project * Creates and returns a job that will asynchronously handle the project template creation. Note that * while the resulting project template can be accessed with the API, it won't be visible in the Asana * UI until Project Templates 2.0 is launched in the app. See more in [this forum post](https://forum.asana.com/t/a-new-api-for-project-templates/156432). * @returns any Successfully created the job to handle project template creation. * @throws ApiError */ projectSaveAsTemplate({ projectGid, requestBody, optPretty, optFields, }: { /** * Globally unique identifier for the project. */ projectGid: string; /** * Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in. */ requestBody: { data?: ProjectSaveAsTemplateRequest; }; /** * 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. */ optPretty?: boolean; /** * 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. */ optFields?: Array; }): CancelablePromise<{ data?: JobCompact; }>; }