import * as Models from './models'; import * as Parameters from './parameters'; import { Callback } from '../callback'; import { Client } from '../clients'; import { RequestConfig } from '../requestConfig'; export class Dashboards { constructor(private client: Client) {} /** * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or * owned dashboards. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getAllDashboards( parameters: Parameters.GetAllDashboards | undefined, callback: Callback, ): Promise; /** * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or * owned dashboards. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getAllDashboards( parameters?: Parameters.GetAllDashboards, callback?: never, ): Promise; async getAllDashboards( parameters?: Parameters.GetAllDashboards, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/dashboard', method: 'GET', params: { filter: parameters?.filter, startAt: parameters?.startAt, maxResults: parameters?.maxResults, }, }; return this.client.sendRequest(config, callback); } /** * Creates a dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async createDashboard( parameters: Parameters.CreateDashboard, callback: Callback, ): Promise; /** * Creates a dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; async createDashboard( parameters: Parameters.CreateDashboard, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/dashboard', method: 'POST', data: { description: parameters.description, editPermissions: parameters.editPermissions, name: parameters.name, sharePermissions: parameters.sharePermissions, }, }; return this.client.sendRequest(config, callback); } /** * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None * * The dashboards to be updated must be owned by the user, or the user must be an administrator. */ async bulkEditDashboards( parameters: Parameters.BulkEditDashboards, callback: Callback, ): Promise; /** * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None * * The dashboards to be updated must be owned by the user, or the user must be an administrator. */ async bulkEditDashboards( parameters: Parameters.BulkEditDashboards, callback?: never, ): Promise; async bulkEditDashboards( parameters: Parameters.BulkEditDashboards, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/dashboard/bulk/edit', method: 'PUT', data: { action: parameters.action, changeOwnerDetails: parameters.changeOwnerDetails, entityIds: parameters.entityIds, extendAdminPermissions: parameters.extendAdminPermissions, permissionDetails: parameters.permissionDetails, }, }; return this.client.sendRequest(config, callback); } /** * Gets a list of all available gadgets that can be added to all dashboards. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getAllAvailableDashboardGadgets( callback: Callback, ): Promise; /** * Gets a list of all available gadgets that can be added to all dashboards. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getAllAvailableDashboardGadgets(callback?: never): Promise; async getAllAvailableDashboardGadgets( callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/dashboard/gadgets', method: 'GET', }; return this.client.sendRequest(config, callback); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. * When multiple attributes are specified only filters matching all attributes are returned. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * following dashboards that match the query parameters are returned: * * - Dashboards owned by the user. Not returned for anonymous users. * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. * - Dashboards shared with a public project. * - Dashboards shared with the public. */ async getDashboardsPaginated( parameters: Parameters.GetDashboardsPaginated | undefined, callback: Callback, ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. * When multiple attributes are specified only filters matching all attributes are returned. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * following dashboards that match the query parameters are returned: * * - Dashboards owned by the user. Not returned for anonymous users. * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. * - Dashboards shared with a public project. * - Dashboards shared with the public. */ async getDashboardsPaginated( parameters?: Parameters.GetDashboardsPaginated, callback?: never, ): Promise; async getDashboardsPaginated( parameters?: Parameters.GetDashboardsPaginated, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/dashboard/search', method: 'GET', params: { dashboardName: parameters?.dashboardName, accountId: parameters?.accountId, groupname: parameters?.groupname, groupId: parameters?.groupId, projectId: parameters?.projectId, orderBy: parameters?.orderBy, startAt: parameters?.startAt, maxResults: parameters?.maxResults, status: parameters?.status, expand: parameters?.expand, }, }; return this.client.sendRequest(config, callback); } /** * Returns a list of dashboard gadgets on a dashboard. * * This operation returns: * * - Gadgets from a list of IDs, when `id` is set. * - Gadgets with a module key, when `moduleKey` is set. * - Gadgets from a list of URIs, when `uri` is set. * - All gadgets, when no other parameters are set. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getAllGadgets( parameters: Parameters.GetAllGadgets | string, callback: Callback, ): Promise; /** * Returns a list of dashboard gadgets on a dashboard. * * This operation returns: * * - Gadgets from a list of IDs, when `id` is set. * - Gadgets with a module key, when `moduleKey` is set. * - Gadgets from a list of URIs, when `uri` is set. * - All gadgets, when no other parameters are set. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getAllGadgets( parameters: Parameters.GetAllGadgets | string, callback?: never, ): Promise; async getAllGadgets( parameters: Parameters.GetAllGadgets | string, callback?: Callback, ): Promise { const dashboardId = typeof parameters === 'string' ? parameters : parameters.dashboardId; const config: RequestConfig = { url: `/rest/api/3/dashboard/${dashboardId}/gadget`, method: 'GET', params: { moduleKey: typeof parameters !== 'string' && parameters.moduleKey, uri: typeof parameters !== 'string' && parameters.uri, gadgetId: typeof parameters !== 'string' && parameters.gadgetId, }, }; return this.client.sendRequest(config, callback); } /** * Adds a gadget to a dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; /** * Adds a gadget to a dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; async addGadget( parameters: Parameters.AddGadget, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget`, method: 'POST', data: { color: parameters.color, ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, moduleKey: parameters.moduleKey, position: parameters.position, title: parameters.title, uri: parameters.uri, }, }; return this.client.sendRequest(config, callback); } /** * Changes the title, position, and color of the gadget on a dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; /** * Changes the title, position, and color of the gadget on a dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, method: 'PUT', data: { color: parameters.color, position: parameters.position, title: parameters.title, }, }; return this.client.sendRequest(config, callback); } /** * Removes a dashboard gadget from a dashboard. * * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied * position. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; /** * Removes a dashboard gadget from a dashboard. * * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied * position. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, method: 'DELETE', }; return this.client.sendRequest(config, callback); } /** * Returns the keys of all properties for a dashboard item. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when * Jira’s anonymous access is permitted. */ async getDashboardItemPropertyKeys( parameters: Parameters.GetDashboardItemPropertyKeys, callback: Callback, ): Promise; /** * Returns the keys of all properties for a dashboard item. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when * Jira’s anonymous access is permitted. */ async getDashboardItemPropertyKeys( parameters: Parameters.GetDashboardItemPropertyKeys, callback?: never, ): Promise; async getDashboardItemPropertyKeys( parameters: Parameters.GetDashboardItemPropertyKeys, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, method: 'GET', }; return this.client.sendRequest(config, callback); } /** * Returns the key and value of a dashboard item property. * * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). * * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this * resource to store the item's content or configuration details. For more information on working with dashboard * items, see [ Building a dashboard item for a JIRA Connect * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) * documentation. * * There is no resource to set or get dashboard items. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when * Jira’s anonymous access is permitted. */ async getDashboardItemProperty( parameters: Parameters.GetDashboardItemProperty, callback: Callback, ): Promise; /** * Returns the key and value of a dashboard item property. * * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). * * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this * resource to store the item's content or configuration details. For more information on working with dashboard * items, see [ Building a dashboard item for a JIRA Connect * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) * documentation. * * There is no resource to set or get dashboard items. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when * Jira’s anonymous access is permitted. */ async getDashboardItemProperty( parameters: Parameters.GetDashboardItemProperty, callback?: never, ): Promise; async getDashboardItemProperty( parameters: Parameters.GetDashboardItemProperty, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, method: 'GET', }; return this.client.sendRequest(config, callback); } /** * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard * item. * * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). * * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this * resource to store the item's content or configuration details. For more information on working with dashboard * items, see [ Building a dashboard item for a JIRA Connect * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) * documentation. * * There is no resource to set or get dashboard items. * * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The * maximum length is 32768 characters. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. */ async setDashboardItemProperty( parameters: Parameters.SetDashboardItemProperty, callback: Callback, ): Promise; /** * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard * item. * * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). * * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this * resource to store the item's content or configuration details. For more information on working with dashboard * items, see [ Building a dashboard item for a JIRA Connect * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) * documentation. * * There is no resource to set or get dashboard items. * * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The * maximum length is 32768 characters. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. */ async setDashboardItemProperty( parameters: Parameters.SetDashboardItemProperty, callback?: never, ): Promise; async setDashboardItemProperty( parameters: Parameters.SetDashboardItemProperty, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, method: 'PUT', headers: { 'Content-Type': 'application/json', }, data: parameters.propertyValue, }; return this.client.sendRequest(config, callback); } /** * Deletes a dashboard item property. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. */ async deleteDashboardItemProperty( parameters: Parameters.DeleteDashboardItemProperty, callback: Callback, ): Promise; /** * Deletes a dashboard item property. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. */ async deleteDashboardItemProperty( parameters: Parameters.DeleteDashboardItemProperty, callback?: never, ): Promise; async deleteDashboardItemProperty( parameters: Parameters.DeleteDashboardItemProperty, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, method: 'DELETE', }; return this.client.sendRequest(config, callback); } /** * Returns a dashboard. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. * * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the * System dashboard. The System dashboard is considered to be shared with all other users. */ async getDashboard( parameters: Parameters.GetDashboard | string, callback: Callback, ): Promise; /** * Returns a dashboard. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. * * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the * System dashboard. The System dashboard is considered to be shared with all other users. */ async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; async getDashboard( parameters: Parameters.GetDashboard | string, callback?: Callback, ): Promise { const id = typeof parameters === 'string' ? parameters : parameters.id; const config: RequestConfig = { url: `/rest/api/3/dashboard/${id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } /** * Updates a dashboard, replacing all the dashboard details with those provided. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None * * The dashboard to be updated must be owned by the user. */ async updateDashboard( parameters: Parameters.UpdateDashboard, callback: Callback, ): Promise; /** * Updates a dashboard, replacing all the dashboard details with those provided. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None * * The dashboard to be updated must be owned by the user. */ async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; async updateDashboard( parameters: Parameters.UpdateDashboard, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.id}`, method: 'PUT', data: { description: parameters.description, editPermissions: parameters.editPermissions, name: parameters.name, sharePermissions: parameters.sharePermissions, }, }; return this.client.sendRequest(config, callback); } /** * Deletes a dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None * * The dashboard to be deleted must be owned by the user. */ async deleteDashboard( parameters: Parameters.DeleteDashboard | string, callback: Callback, ): Promise; /** * Deletes a dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None * * The dashboard to be deleted must be owned by the user. */ async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; async deleteDashboard( parameters: Parameters.DeleteDashboard | string, callback?: Callback, ): Promise { const id = typeof parameters === 'string' ? parameters : parameters.id; const config: RequestConfig = { url: `/rest/api/3/dashboard/${id}`, method: 'DELETE', }; return this.client.sendRequest(config, callback); } /** * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None * * The dashboard to be copied must be owned by or shared with the user. */ async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; /** * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None * * The dashboard to be copied must be owned by or shared with the user. */ async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; async copyDashboard( parameters: Parameters.CopyDashboard, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.id}/copy`, method: 'POST', data: { description: parameters.description, editPermissions: parameters.editPermissions, name: parameters.name, sharePermissions: parameters.sharePermissions, }, }; return this.client.sendRequest(config, callback); } }