UNPKG

fetch-jsd

Version:

A simple and typed library, based on OpenAPI spec from developer.atlassian.com, for accessing product APIs.

302 lines (301 loc) 26.3 kB
/** * Service Desk Public REST API * Public REST API for Jira Service Desk * * The version of the OpenAPI document: 1001.0.0-SNAPSHOT * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { CustomerRequestCreateMetaDTO, EntityProperty, PagedDTOArticleDTO, PagedDTOIssueBean, PagedDTOQueueDTO, PagedDTORequestTypeDTO, PagedDTORequestTypeGroupDTO, PagedDTOServiceDeskDTO, PagedDTOUserDTO, PropertyKeys, QueueDTO, RequestTypeCreateDTO, RequestTypeDTO, ServiceDeskCustomerDTO, ServiceDeskDTO } from '../models'; export interface AddCustomersRequest { serviceDeskId: number; ServiceDeskCustomerDTO: ServiceDeskCustomerDTO; } export interface AttachTemporaryFileRequest { serviceDeskId: number; } export interface CreateRequestTypeRequest { serviceDeskId: number; RequestTypeCreateDTO: RequestTypeCreateDTO; } export interface DeleteProperty1Request { serviceDeskId: number; requestTypeId: number; propertyKey: string; } export interface GetArticles1Request { serviceDeskId: number; query?: string; highlight?: boolean; start?: number; limit?: number; } export interface GetCustomersRequest { serviceDeskId: number; query?: string; start?: number; limit?: number; } export interface GetIssuesInQueueRequest { serviceDeskId: number; queueId: number; start?: number; limit?: number; } export interface GetPropertiesKeys1Request { requestTypeId: number; serviceDeskId: number; } export interface GetProperty1Request { serviceDeskId: number; requestTypeId: number; propertyKey: string; } export interface GetQueueRequest { serviceDeskId: number; queueId: number; includeCount?: boolean; } export interface GetQueuesRequest { serviceDeskId: number; includeCount?: boolean; start?: number; limit?: number; } export interface GetRequestTypeByIdRequest { serviceDeskId: number; requestTypeId: number; expand?: Array<string>; } export interface GetRequestTypeFieldsRequest { serviceDeskId: number; requestTypeId: number; } export interface GetRequestTypeGroupsRequest { serviceDeskId: number; start?: number; limit?: number; } export interface GetRequestTypesRequest { serviceDeskId: number; groupId?: number; expand?: Array<string>; searchQuery?: string; start?: number; limit?: number; } export interface GetServiceDeskByIdRequest { serviceDeskId: number; } export interface GetServiceDesksRequest { start?: number; limit?: number; } export interface RemoveCustomersRequest { serviceDeskId: number; ServiceDeskCustomerDTO: ServiceDeskCustomerDTO; } export interface SetProperty1Request { serviceDeskId: number; requestTypeId: number; propertyKey: string; } /** * no description */ export declare class ServicedeskApi extends runtime.BaseAPI { /** * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, no changes will be made for those customers and the resource returns a 204 success code. **[Permissions](#permissions) required**: Service desk administrator * Add customers */ addCustomersRaw(requestParameters: AddCustomersRequest): Promise<runtime.ApiResponse<void>>; /** * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, no changes will be made for those customers and the resource returns a 204 success code. **[Permissions](#permissions) required**: Service desk administrator * Add customers */ addCustomers(requestParameters: AddCustomersRequest): Promise<void>; /** * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a customer request using [servicedeskapi/request/\\{issueIdOrKey\\}/attachment](#api-request-issueIdOrKey-attachment-post). **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service desk. This method expects a multipart request. The media-type multipart/form-data is defined in RFC 1867. Most client libraries have classes that make dealing with multipart posts simple. For instance, in Java the Apache HTTP Components library provides [MultiPartEntity](http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html). Because this method accepts multipart/form-data, it has XSRF protection on it. This means you must submit a header of X-Atlassian-Token: no-check with the request or it will be blocked. The name of the multipart/form-data parameter that contains the attachments must be `file`. For example, to upload a file called `myfile.txt` in the Service Desk with ID 10001 use curl -D- -u customer:customer -X POST -H \"X-ExperimentalApi: opt-in\" -H \"X-Atlassian-Token: no-check\" -F \"file=@myfile.txt\" https://your-domain.atlassian.net/rest/servicedeskapi/servicedesk/10001/attachTemporaryFile **[Permissions](#permissions) required**: Permission to add attachments in this Service Desk. * Attach temporary file */ attachTemporaryFileRaw(requestParameters: AttachTemporaryFileRequest): Promise<runtime.ApiResponse<any>>; /** * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a customer request using [servicedeskapi/request/\\{issueIdOrKey\\}/attachment](#api-request-issueIdOrKey-attachment-post). **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service desk. This method expects a multipart request. The media-type multipart/form-data is defined in RFC 1867. Most client libraries have classes that make dealing with multipart posts simple. For instance, in Java the Apache HTTP Components library provides [MultiPartEntity](http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html). Because this method accepts multipart/form-data, it has XSRF protection on it. This means you must submit a header of X-Atlassian-Token: no-check with the request or it will be blocked. The name of the multipart/form-data parameter that contains the attachments must be `file`. For example, to upload a file called `myfile.txt` in the Service Desk with ID 10001 use curl -D- -u customer:customer -X POST -H \"X-ExperimentalApi: opt-in\" -H \"X-Atlassian-Token: no-check\" -F \"file=@myfile.txt\" https://your-domain.atlassian.net/rest/servicedeskapi/servicedesk/10001/attachTemporaryFile **[Permissions](#permissions) required**: Permission to add attachments in this Service Desk. * Attach temporary file */ attachTemporaryFile(requestParameters: AttachTemporaryFileRequest): Promise<any>; /** * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all customer request type fields can be specified in the request and these fields are given the following default values: * Request type icon is given the question mark icon. * Request type groups is left empty, which means this customer request type will not be visible on the [customer portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). * Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status map from the issue type upon which it is based. * Request type field mapping is set to show the required fields as specified by the issue type used to create the customer request type. These fields can be updated by a service desk administrator using the **Request types** option in **Project settings**. Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create issue type endpoint instead. **[Permissions](#permissions) required**: Service desk\'s administrator * Create request type */ createRequestTypeRaw(requestParameters: CreateRequestTypeRequest): Promise<runtime.ApiResponse<RequestTypeDTO>>; /** * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all customer request type fields can be specified in the request and these fields are given the following default values: * Request type icon is given the question mark icon. * Request type groups is left empty, which means this customer request type will not be visible on the [customer portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). * Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status map from the issue type upon which it is based. * Request type field mapping is set to show the required fields as specified by the issue type used to create the customer request type. These fields can be updated by a service desk administrator using the **Request types** option in **Project settings**. Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create issue type endpoint instead. **[Permissions](#permissions) required**: Service desk\'s administrator * Create request type */ createRequestType(requestParameters: CreateRequestTypeRequest): Promise<RequestTypeDTO>; /** * Removes a property from a request type. Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by calling the Jira Cloud Platform [Delete issue type property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) endpoint. **[Permissions](#permissions) required**: Jira project administrator with a Jira Service Desk agent license. * Delete property */ deleteProperty1Raw(requestParameters: DeleteProperty1Request): Promise<runtime.ApiResponse<void>>; /** * Removes a property from a request type. Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by calling the Jira Cloud Platform [Delete issue type property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) endpoint. **[Permissions](#permissions) required**: Jira project administrator with a Jira Service Desk agent license. * Delete property */ deleteProperty1(requestParameters: DeleteProperty1Request): Promise<void>; /** * Returns articles which match the given query and belong to the knowledge base linked to the service desk. **[Permissions](#permissions) required**: Permission to access the service desk. * Get articles */ getArticles1Raw(requestParameters: GetArticles1Request): Promise<runtime.ApiResponse<PagedDTOArticleDTO>>; /** * Returns articles which match the given query and belong to the knowledge base linked to the service desk. **[Permissions](#permissions) required**: Permission to access the service desk. * Get articles */ getArticles1(requestParameters: GetArticles1Request): Promise<PagedDTOArticleDTO>; /** * This method returns a list of the customers on a service desk. The returned list of customers can be filtered using the `query` parameter. The parameter is matched against customers\' `displayName`, `name`, or `email`. For example, searching for \"John\", \"Jo\", \"Smi\", or \"Smith\" will match a user with display name \"John Smith\". **[Permissions](#permissions) required**: Permission to view this Service Desk\'s customers. * Get customers */ getCustomersRaw(requestParameters: GetCustomersRequest): Promise<runtime.ApiResponse<PagedDTOUserDTO>>; /** * This method returns a list of the customers on a service desk. The returned list of customers can be filtered using the `query` parameter. The parameter is matched against customers\' `displayName`, `name`, or `email`. For example, searching for \"John\", \"Jo\", \"Smi\", or \"Smith\" will match a user with display name \"John Smith\". **[Permissions](#permissions) required**: Permission to view this Service Desk\'s customers. * Get customers */ getCustomers(requestParameters: GetCustomersRequest): Promise<PagedDTOUserDTO>; /** * This method returns the customer requests in a queue. Only fields that the queue is configured to show are returned. For example, if a queue is configured to show description and due date, then only those two fields are returned for each customer request in the queue. **[Permissions](#permissions) required**: Service desk\'s agent. * Get issues in queue */ getIssuesInQueueRaw(requestParameters: GetIssuesInQueueRequest): Promise<runtime.ApiResponse<PagedDTOIssueBean>>; /** * This method returns the customer requests in a queue. Only fields that the queue is configured to show are returned. For example, if a queue is configured to show description and due date, then only those two fields are returned for each customer request in the queue. **[Permissions](#permissions) required**: Service desk\'s agent. * Get issues in queue */ getIssuesInQueue(requestParameters: GetIssuesInQueueRequest): Promise<PagedDTOIssueBean>; /** * Returns the keys of all properties for a request type. Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) endpoint. **[Permissions](#permissions) required**: The user must have permission to view the request type. * Get properties keys */ getPropertiesKeys1Raw(requestParameters: GetPropertiesKeys1Request): Promise<runtime.ApiResponse<PropertyKeys>>; /** * Returns the keys of all properties for a request type. Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) endpoint. **[Permissions](#permissions) required**: The user must have permission to view the request type. * Get properties keys */ getPropertiesKeys1(requestParameters: GetPropertiesKeys1Request): Promise<PropertyKeys>; /** * Returns the value of the property from a request type. Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by calling the Jira Cloud Platform [Get issue type property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) endpoint. **[Permissions](#permissions) required**: User must have permission to view the request type. * Get property */ getProperty1Raw(requestParameters: GetProperty1Request): Promise<runtime.ApiResponse<EntityProperty>>; /** * Returns the value of the property from a request type. Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by calling the Jira Cloud Platform [Get issue type property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) endpoint. **[Permissions](#permissions) required**: User must have permission to view the request type. * Get property */ getProperty1(requestParameters: GetProperty1Request): Promise<EntityProperty>; /** * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). **[Permissions](#permissions) required**: service desk\'s Agent. * Get queue */ getQueueRaw(requestParameters: GetQueueRequest): Promise<runtime.ApiResponse<QueueDTO>>; /** * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). **[Permissions](#permissions) required**: service desk\'s Agent. * Get queue */ getQueue(requestParameters: GetQueueRequest): Promise<QueueDTO>; /** * This method returns the queues in a service desk. To include a customer request count for each queue (in the `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). **[Permissions](#permissions) required**: service desk\'s Agent. * Get queues */ getQueuesRaw(requestParameters: GetQueuesRequest): Promise<runtime.ApiResponse<PagedDTOQueueDTO>>; /** * This method returns the queues in a service desk. To include a customer request count for each queue (in the `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). **[Permissions](#permissions) required**: service desk\'s Agent. * Get queues */ getQueues(requestParameters: GetQueuesRequest): Promise<PagedDTOQueueDTO>; /** * This method returns a customer request type from a service desk. **[Permissions](#permissions) required**: Permission to access the service desk. * Get request type by id */ getRequestTypeByIdRaw(requestParameters: GetRequestTypeByIdRequest): Promise<runtime.ApiResponse<RequestTypeDTO>>; /** * This method returns a customer request type from a service desk. **[Permissions](#permissions) required**: Permission to access the service desk. * Get request type by id */ getRequestTypeById(requestParameters: GetRequestTypeByIdRequest): Promise<RequestTypeDTO>; /** * This method returns the fields for a service desk\'s customer request type. Also, the following information about the user\'s permissions for the request type is returned: * `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other customers. Otherwise, returns `false`. * `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns `false`. **[Permissions](#permissions) required**: Permission to view the Service Desk. * Get request type fields */ getRequestTypeFieldsRaw(requestParameters: GetRequestTypeFieldsRequest): Promise<runtime.ApiResponse<CustomerRequestCreateMetaDTO>>; /** * This method returns the fields for a service desk\'s customer request type. Also, the following information about the user\'s permissions for the request type is returned: * `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other customers. Otherwise, returns `false`. * `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns `false`. **[Permissions](#permissions) required**: Permission to view the Service Desk. * Get request type fields */ getRequestTypeFields(requestParameters: GetRequestTypeFieldsRequest): Promise<CustomerRequestCreateMetaDTO>; /** * This method returns a service desk\'s customer request type groups. Jira Service Desk administrators can arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are returned in this order. **[Permissions](#permissions) required**: Permission to view the service desk. * Get request type groups */ getRequestTypeGroupsRaw(requestParameters: GetRequestTypeGroupsRequest): Promise<runtime.ApiResponse<PagedDTORequestTypeGroupDTO>>; /** * This method returns a service desk\'s customer request type groups. Jira Service Desk administrators can arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are returned in this order. **[Permissions](#permissions) required**: Permission to view the service desk. * Get request type groups */ getRequestTypeGroups(requestParameters: GetRequestTypeGroupsRequest): Promise<PagedDTORequestTypeGroupDTO>; /** * This method returns all customer request types from a service desk. There are two parameters for filtering the returned list: * `groupId` which filters the results to items in the customer request type group. * `searchQuery` which is matched against request types\' `name` or `description`. For example, the strings \"Install\", \"Inst\", \"Equi\", or \"Equipment\" will match a request type with the *name* \"Equipment Installation Request\". **[Permissions](#permissions) required**: Permission to access the service desk. * Get request types */ getRequestTypesRaw(requestParameters: GetRequestTypesRequest): Promise<runtime.ApiResponse<PagedDTORequestTypeDTO>>; /** * This method returns all customer request types from a service desk. There are two parameters for filtering the returned list: * `groupId` which filters the results to items in the customer request type group. * `searchQuery` which is matched against request types\' `name` or `description`. For example, the strings \"Install\", \"Inst\", \"Equi\", or \"Equipment\" will match a request type with the *name* \"Equipment Installation Request\". **[Permissions](#permissions) required**: Permission to access the service desk. * Get request types */ getRequestTypes(requestParameters: GetRequestTypesRequest): Promise<PagedDTORequestTypeDTO>; /** * This method returns a service desk. Use this method to get service desk details whenever your application component is passed a service desk ID but needs to display other service desk details. **[Permissions](#permissions) required**: Permission to access the Service Desk. For example, being the Service Desk\'s Administrator or one of its Agents or Users. * Get service desk by id */ getServiceDeskByIdRaw(requestParameters: GetServiceDeskByIdRequest): Promise<runtime.ApiResponse<ServiceDeskDTO>>; /** * This method returns a service desk. Use this method to get service desk details whenever your application component is passed a service desk ID but needs to display other service desk details. **[Permissions](#permissions) required**: Permission to access the Service Desk. For example, being the Service Desk\'s Administrator or one of its Agents or Users. * Get service desk by id */ getServiceDeskById(requestParameters: GetServiceDeskByIdRequest): Promise<ServiceDeskDTO>; /** * This method returns all the service desks in the Jira Service Desk instance that the user has permission to access. Use this method where you need a list of service desks or need to locate a service desk by name or keyword. **[Permissions](#permissions) required**: Any * Get service desks */ getServiceDesksRaw(requestParameters: GetServiceDesksRequest): Promise<runtime.ApiResponse<PagedDTOServiceDeskDTO>>; /** * This method returns all the service desks in the Jira Service Desk instance that the user has permission to access. Use this method where you need a list of service desks or need to locate a service desk by name or keyword. **[Permissions](#permissions) required**: Any * Get service desks */ getServiceDesks(requestParameters: GetServiceDesksRequest): Promise<PagedDTOServiceDeskDTO>; /** * This method removes one or more customers from a service desk. The service desk must have closed access. If any of the passed customers are not associated with the service desk, no changes will be made for those customers and the resource returns a 204 success code. **[Permissions](#permissions) required**: Services desk administrator * Remove customers */ removeCustomersRaw(requestParameters: RemoveCustomersRequest): Promise<runtime.ApiResponse<void>>; /** * This method removes one or more customers from a service desk. The service desk must have closed access. If any of the passed customers are not associated with the service desk, no changes will be made for those customers and the resource returns a 204 success code. **[Permissions](#permissions) required**: Services desk administrator * Remove customers */ removeCustomers(requestParameters: RemoveCustomersRequest): Promise<void>; /** * Sets the value of a request type property. Use this resource to store custom data against a request type. Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by calling the Jira Cloud Platform [Set issue type property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) endpoint. **[Permissions](#permissions) required**: Jira project administrator with a Jira Service Desk agent license. * Set property */ setProperty1Raw(requestParameters: SetProperty1Request): Promise<runtime.ApiResponse<object>>; /** * Sets the value of a request type property. Use this resource to store custom data against a request type. Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by calling the Jira Cloud Platform [Set issue type property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) endpoint. **[Permissions](#permissions) required**: Jira project administrator with a Jira Service Desk agent license. * Set property */ setProperty1(requestParameters: SetProperty1Request): Promise<object>; }