UNPKG

fetch-jsd

Version:

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

399 lines (398 loc) 28.8 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 { ApprovalDTO, ApprovalDecisionRequestDTO, AttachmentCreateDTO, AttachmentCreateResultDTO, CSATFeedbackFullDTO, CommentCreateDTO, CommentDTO, CustomerRequestDTO, CustomerTransitionExecutionDTO, PagedDTOApprovalDTO, PagedDTOAttachmentDTO, PagedDTOCommentDTO, PagedDTOCustomerRequestDTO, PagedDTOCustomerRequestStatusDTO, PagedDTOCustomerTransitionDTO, PagedDTOSlaInformationDTO, PagedDTOUserDTO, RequestCreateDTO, RequestNotificationSubscriptionDTO, RequestParticipantUpdateDTO, SlaInformationDTO } from '../models'; export interface AddRequestParticipantsRequest { issueIdOrKey: string; RequestParticipantUpdateDTO: RequestParticipantUpdateDTO; } export interface AnswerApprovalRequest { issueIdOrKey: string; approvalId: number; ApprovalDecisionRequestDTO: ApprovalDecisionRequestDTO; } export interface CreateAttachmentRequest { issueIdOrKey: string; AttachmentCreateDTO: AttachmentCreateDTO; } export interface CreateCustomerRequestRequest { RequestCreateDTO: RequestCreateDTO; } export interface CreateRequestCommentRequest { issueIdOrKey: string; CommentCreateDTO: CommentCreateDTO; } export interface DeleteFeedbackRequest { requestIdOrKey: string; } export interface GetApprovalByIdRequest { issueIdOrKey: string; approvalId: number; } export interface GetApprovalsRequest { issueIdOrKey: string; start?: number; limit?: number; } export interface GetAttachmentsForRequestRequest { issueIdOrKey: string; start?: number; limit?: number; } export interface GetCommentAttachmentsRequest { issueIdOrKey: string; commentId: number; start?: number; limit?: number; } export interface GetCustomerRequestByIdOrKeyRequest { issueIdOrKey: string; expand?: Array<string>; } export interface GetCustomerRequestStatusRequest { issueIdOrKey: string; start?: number; limit?: number; } export interface GetCustomerRequestsRequest { searchTerm?: string; requestOwnership?: Array<string>; requestStatus?: string; approvalStatus?: string; organizationId?: number; serviceDeskId?: number; requestTypeId?: number; expand?: Array<string>; start?: number; limit?: number; } export interface GetCustomerTransitionsRequest { issueIdOrKey: string; start?: number; limit?: number; } export interface GetFeedbackRequest { requestIdOrKey: string; } export interface GetRequestCommentByIdRequest { issueIdOrKey: string; commentId: number; expand?: Array<string>; } export interface GetRequestCommentsRequest { issueIdOrKey: string; _public?: boolean; internal?: boolean; expand?: Array<string>; start?: number; limit?: number; } export interface GetRequestParticipantsRequest { issueIdOrKey: string; start?: number; limit?: number; } export interface GetSlaInformationRequest { issueIdOrKey: string; start?: number; limit?: number; } export interface GetSlaInformationByIdRequest { issueIdOrKey: string; slaMetricId: number; } export interface GetSubscriptionStatusRequest { issueIdOrKey: string; } export interface PerformCustomerTransitionRequest { issueIdOrKey: string; CustomerTransitionExecutionDTO: CustomerTransitionExecutionDTO; } export interface PostFeedbackRequest { requestIdOrKey: string; CSATFeedbackFullDTO: CSATFeedbackFullDTO; } export interface RemoveRequestParticipantsRequest { issueIdOrKey: string; RequestParticipantUpdateDTO: RequestParticipantUpdateDTO; } export interface SubscribeRequest { issueIdOrKey: string; } export interface UnsubscribeRequest { issueIdOrKey: string; } /** * no description */ export declare class RequestApi extends runtime.BaseAPI { /** * This method adds participants to a customer request. **[Permissions](#permissions) required**: Permission to manage participants on the customer request. Note, participants can be added when creating a customer request using the [request](#api-request-post) resource, by defining the participants in the `requestParticipants` field. * Add request participants */ addRequestParticipantsRaw(requestParameters: AddRequestParticipantsRequest): Promise<runtime.ApiResponse<PagedDTOUserDTO>>; /** * This method adds participants to a customer request. **[Permissions](#permissions) required**: Permission to manage participants on the customer request. Note, participants can be added when creating a customer request using the [request](#api-request-post) resource, by defining the participants in the `requestParticipants` field. * Add request participants */ addRequestParticipants(requestParameters: AddRequestParticipantsRequest): Promise<PagedDTOUserDTO>; /** * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed to be owned by the user making the call. **[Permissions](#permissions) required**: User is assigned to the approval request. * Answer approval */ answerApprovalRaw(requestParameters: AnswerApprovalRequest): Promise<runtime.ApiResponse<ApprovalDTO>>; /** * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed to be owned by the user making the call. **[Permissions](#permissions) required**: User is assigned to the approval request. * Answer approval */ answerApproval(requestParameters: AnswerApprovalRequest): Promise<ApprovalDTO>; /** * This method adds one or more temporary files (attached to the request\'s service desk using [servicedesk/\\{serviceDeskId\\}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible to include a comment with the attachments. To get a list of attachments for a comment on the request use [servicedeskapi/request/\\{issueIdOrKey\\}/comment/\\{commentId\\}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). **[Permissions](#permissions) required**: Permission to add an attachment. **Request limitations**: Customers can set attachments to public visibility only. * Create attachment */ createAttachmentRaw(requestParameters: CreateAttachmentRequest): Promise<runtime.ApiResponse<AttachmentCreateResultDTO>>; /** * This method adds one or more temporary files (attached to the request\'s service desk using [servicedesk/\\{serviceDeskId\\}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible to include a comment with the attachments. To get a list of attachments for a comment on the request use [servicedeskapi/request/\\{issueIdOrKey\\}/comment/\\{commentId\\}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). **[Permissions](#permissions) required**: Permission to add an attachment. **Request limitations**: Customers can set attachments to public visibility only. * Create attachment */ createAttachment(requestParameters: CreateAttachmentRequest): Promise<AttachmentCreateResultDTO>; /** * This method creates a customer request in a service desk. The JSON request must include the service desk and customer request type, as well as any fields that are required for the request type. A list of the fields required by a customer request type can be obtained using [servicedesk/\\{serviceDeskId\\}/requesttype/\\{requestTypeId\\}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). The fields required for a customer request type depend on the user\'s permissions: * `raiseOnBehalfOf` is not available to Users who have the customer permission only. * `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned off for customers. `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for details of each field\'s JSON semantics and the values they can take. **[Permissions](#permissions) required**: Permission to create requests in the specified service desk. * Create customer request */ createCustomerRequestRaw(requestParameters: CreateCustomerRequestRequest): Promise<runtime.ApiResponse<CustomerRequestDTO>>; /** * This method creates a customer request in a service desk. The JSON request must include the service desk and customer request type, as well as any fields that are required for the request type. A list of the fields required by a customer request type can be obtained using [servicedesk/\\{serviceDeskId\\}/requesttype/\\{requestTypeId\\}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). The fields required for a customer request type depend on the user\'s permissions: * `raiseOnBehalfOf` is not available to Users who have the customer permission only. * `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned off for customers. `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for details of each field\'s JSON semantics and the values they can take. **[Permissions](#permissions) required**: Permission to create requests in the specified service desk. * Create customer request */ createCustomerRequest(requestParameters: CreateCustomerRequestRequest): Promise<CustomerRequestDTO>; /** * This method creates a public or private (internal) comment on a customer request, with the comment visibility set by `public`. The user recorded as the author of the comment. **[Permissions](#permissions) required**: User has Add Comments permission. **Request limitations**: Customers can set comments to public visibility only. * Create request comment */ createRequestCommentRaw(requestParameters: CreateRequestCommentRequest): Promise<runtime.ApiResponse<CommentDTO>>; /** * This method creates a public or private (internal) comment on a customer request, with the comment visibility set by `public`. The user recorded as the author of the comment. **[Permissions](#permissions) required**: User has Add Comments permission. **Request limitations**: Customers can set comments to public visibility only. * Create request comment */ createRequestComment(requestParameters: CreateRequestCommentRequest): Promise<CommentDTO>; /** * This method deletes the feedback of request using it\'s `requestKey` or `requestId` **[Permissions](#permissions) required**: User must be the reporter or an Atlassian Connect app. * Delete feedback */ deleteFeedbackRaw(requestParameters: DeleteFeedbackRequest): Promise<runtime.ApiResponse<object>>; /** * This method deletes the feedback of request using it\'s `requestKey` or `requestId` **[Permissions](#permissions) required**: User must be the reporter or an Atlassian Connect app. * Delete feedback */ deleteFeedback(requestParameters: DeleteFeedbackRequest): Promise<object>; /** * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. **[Permissions](#permissions) required**: Permission to view the customer request. * Get approval by id */ getApprovalByIdRaw(requestParameters: GetApprovalByIdRequest): Promise<runtime.ApiResponse<ApprovalDTO>>; /** * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. **[Permissions](#permissions) required**: Permission to view the customer request. * Get approval by id */ getApprovalById(requestParameters: GetApprovalByIdRequest): Promise<ApprovalDTO>; /** * This method returns all approvals on a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Get approvals */ getApprovalsRaw(requestParameters: GetApprovalsRequest): Promise<runtime.ApiResponse<PagedDTOApprovalDTO>>; /** * This method returns all approvals on a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Get approvals */ getApprovals(requestParameters: GetApprovalsRequest): Promise<PagedDTOApprovalDTO>; /** * This method returns all the attachments for a customer requests. **[Permissions](#permissions) required**: Permission to view the customer request. **Response limitations**: Customers will only get a list of public attachments. * Get attachments for request */ getAttachmentsForRequestRaw(requestParameters: GetAttachmentsForRequestRequest): Promise<runtime.ApiResponse<PagedDTOAttachmentDTO>>; /** * This method returns all the attachments for a customer requests. **[Permissions](#permissions) required**: Permission to view the customer request. **Response limitations**: Customers will only get a list of public attachments. * Get attachments for request */ getAttachmentsForRequest(requestParameters: GetAttachmentsForRequestRequest): Promise<PagedDTOAttachmentDTO>; /** * This method returns the attachments referenced in a comment. **[Permissions](#permissions) required**: Permission to view the customer request. **Response limitations**: Customers can only view public comments, and retrieve their attachements, on requests where they are the reporter or a participant whereas agents can see both internal and public comments. * Get comment attachments */ getCommentAttachmentsRaw(requestParameters: GetCommentAttachmentsRequest): Promise<runtime.ApiResponse<PagedDTOAttachmentDTO>>; /** * This method returns the attachments referenced in a comment. **[Permissions](#permissions) required**: Permission to view the customer request. **Response limitations**: Customers can only view public comments, and retrieve their attachements, on requests where they are the reporter or a participant whereas agents can see both internal and public comments. * Get comment attachments */ getCommentAttachments(requestParameters: GetCommentAttachmentsRequest): Promise<PagedDTOAttachmentDTO>; /** * This method returns a customer request. **[Permissions](#permissions) required**: Permission to access the specified service desk. **Response limitations**: For customers, only a request they created, was created on their behalf, or they are participating in will be returned. * Get customer request by id or key */ getCustomerRequestByIdOrKeyRaw(requestParameters: GetCustomerRequestByIdOrKeyRequest): Promise<runtime.ApiResponse<CustomerRequestDTO>>; /** * This method returns a customer request. **[Permissions](#permissions) required**: Permission to access the specified service desk. **Response limitations**: For customers, only a request they created, was created on their behalf, or they are participating in will be returned. * Get customer request by id or key */ getCustomerRequestByIdOrKey(requestParameters: GetCustomerRequestByIdOrKeyRequest): Promise<CustomerRequestDTO>; /** * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an issue in its workflow. An issue can have one active status only. The list returns the status history in chronological order, most recent (current) status first. **[Permissions](#permissions) required**: Permission to view the customer request. * Get customer request status */ getCustomerRequestStatusRaw(requestParameters: GetCustomerRequestStatusRequest): Promise<runtime.ApiResponse<PagedDTOCustomerRequestStatusDTO>>; /** * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an issue in its workflow. An issue can have one active status only. The list returns the status history in chronological order, most recent (current) status first. **[Permissions](#permissions) required**: Permission to view the customer request. * Get customer request status */ getCustomerRequestStatus(requestParameters: GetCustomerRequestStatusRequest): Promise<PagedDTOCustomerRequestStatusDTO>; /** * This method returns all customer requests for the user executing the query. The returned customer requests are ordered chronologically by the latest activity on each request. For example, the latest status transition or comment. **[Permissions](#permissions) required**: Permission to access the specified service desk. **Response limitations**: For customers, the list returned will include request they created (or were created on their behalf) or are participating in only. * Get customer requests */ getCustomerRequestsRaw(requestParameters: GetCustomerRequestsRequest): Promise<runtime.ApiResponse<PagedDTOCustomerRequestDTO>>; /** * This method returns all customer requests for the user executing the query. The returned customer requests are ordered chronologically by the latest activity on each request. For example, the latest status transition or comment. **[Permissions](#permissions) required**: Permission to access the specified service desk. **Response limitations**: For customers, the list returned will include request they created (or were created on their behalf) or are participating in only. * Get customer requests */ getCustomerRequests(requestParameters: GetCustomerRequestsRequest): Promise<PagedDTOCustomerRequestDTO>; /** * This method returns a list of transitions, the workflow processes that moves a customer request from one status to another, that the user can perform on a request. Use this method to provide a user with a list if the actions they can take on a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Get customer transitions */ getCustomerTransitionsRaw(requestParameters: GetCustomerTransitionsRequest): Promise<runtime.ApiResponse<PagedDTOCustomerTransitionDTO>>; /** * This method returns a list of transitions, the workflow processes that moves a customer request from one status to another, that the user can perform on a request. Use this method to provide a user with a list if the actions they can take on a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Get customer transitions */ getCustomerTransitions(requestParameters: GetCustomerTransitionsRequest): Promise<PagedDTOCustomerTransitionDTO>; /** * This method retrieves a feedback of a request using it\'s `requestKey` or `requestId` **[Permissions](#permissions) required**: User has view request permissions. * Get feedback */ getFeedbackRaw(requestParameters: GetFeedbackRequest): Promise<runtime.ApiResponse<CSATFeedbackFullDTO>>; /** * This method retrieves a feedback of a request using it\'s `requestKey` or `requestId` **[Permissions](#permissions) required**: User has view request permissions. * Get feedback */ getFeedback(requestParameters: GetFeedbackRequest): Promise<CSATFeedbackFullDTO>; /** * This method returns details of a customer request\'s comment. **[Permissions](#permissions) required**: Permission to view the customer request. **Response limitations**: Customers can only view public comments on requests where they are the reporter or a participant whereas agents can see both internal and public comments. * Get request comment by id */ getRequestCommentByIdRaw(requestParameters: GetRequestCommentByIdRequest): Promise<runtime.ApiResponse<CommentDTO>>; /** * This method returns details of a customer request\'s comment. **[Permissions](#permissions) required**: Permission to view the customer request. **Response limitations**: Customers can only view public comments on requests where they are the reporter or a participant whereas agents can see both internal and public comments. * Get request comment by id */ getRequestCommentById(requestParameters: GetRequestCommentByIdRequest): Promise<CommentDTO>; /** * This method returns all comments on a customer request. No permissions error is provided if, for example, the user doesn\'t have access to the service desk or request, the method simply returns an empty response. **[Permissions](#permissions) required**: Permission to view the customer request. **Response limitations**: Customers are returned public comments only. * Get request comments */ getRequestCommentsRaw(requestParameters: GetRequestCommentsRequest): Promise<runtime.ApiResponse<PagedDTOCommentDTO>>; /** * This method returns all comments on a customer request. No permissions error is provided if, for example, the user doesn\'t have access to the service desk or request, the method simply returns an empty response. **[Permissions](#permissions) required**: Permission to view the customer request. **Response limitations**: Customers are returned public comments only. * Get request comments */ getRequestComments(requestParameters: GetRequestCommentsRequest): Promise<PagedDTOCommentDTO>; /** * This method returns a list of all the participants on a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Get request participants */ getRequestParticipantsRaw(requestParameters: GetRequestParticipantsRequest): Promise<runtime.ApiResponse<PagedDTOUserDTO>>; /** * This method returns a list of all the participants on a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Get request participants */ getRequestParticipants(requestParameters: GetRequestParticipantsRequest): Promise<PagedDTOUserDTO>; /** * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each SLA can have recordings for zero or more \"completed cycles\" and zero or 1 \"ongoing cycle\". Each cycle includes information on when it started and stopped, and whether it breached the SLA goal. **[Permissions](#permissions) required**: Agent for the Service Desk containing the queried customer request. * Get sla information */ getSlaInformationRaw(requestParameters: GetSlaInformationRequest): Promise<runtime.ApiResponse<PagedDTOSlaInformationDTO>>; /** * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each SLA can have recordings for zero or more \"completed cycles\" and zero or 1 \"ongoing cycle\". Each cycle includes information on when it started and stopped, and whether it breached the SLA goal. **[Permissions](#permissions) required**: Agent for the Service Desk containing the queried customer request. * Get sla information */ getSlaInformation(requestParameters: GetSlaInformationRequest): Promise<PagedDTOSlaInformationDTO>; /** * This method returns the details for an SLA on a customer request. **[Permissions](#permissions) required**: Agent for the Service Desk containing the queried customer request. * Get sla information by id */ getSlaInformationByIdRaw(requestParameters: GetSlaInformationByIdRequest): Promise<runtime.ApiResponse<SlaInformationDTO>>; /** * This method returns the details for an SLA on a customer request. **[Permissions](#permissions) required**: Agent for the Service Desk containing the queried customer request. * Get sla information by id */ getSlaInformationById(requestParameters: GetSlaInformationByIdRequest): Promise<SlaInformationDTO>; /** * This method returns the notification subscription status of the user making the request. Use this method to determine if the user is subscribed to a customer request\'s notifications. **[Permissions](#permissions) required**: Permission to view the customer request. * Get subscription status */ getSubscriptionStatusRaw(requestParameters: GetSubscriptionStatusRequest): Promise<runtime.ApiResponse<RequestNotificationSubscriptionDTO>>; /** * This method returns the notification subscription status of the user making the request. Use this method to determine if the user is subscribed to a customer request\'s notifications. **[Permissions](#permissions) required**: Permission to view the customer request. * Get subscription status */ getSubscriptionStatus(requestParameters: GetSubscriptionStatusRequest): Promise<RequestNotificationSubscriptionDTO>; /** * This method performs a customer transition for a given request and transition. An optional comment can be included to provide a reason for the transition. **[Permissions](#permissions) required**: The user must be able to view the request and have the Transition Issues permission. If a comment is passed the user must have the Add Comments permission. * Perform customer transition */ performCustomerTransitionRaw(requestParameters: PerformCustomerTransitionRequest): Promise<runtime.ApiResponse<void>>; /** * This method performs a customer transition for a given request and transition. An optional comment can be included to provide a reason for the transition. **[Permissions](#permissions) required**: The user must be able to view the request and have the Transition Issues permission. If a comment is passed the user must have the Add Comments permission. * Perform customer transition */ performCustomerTransition(requestParameters: PerformCustomerTransitionRequest): Promise<void>; /** * This method adds a feedback on an request using it\'s `requestKey` or `requestId` **[Permissions](#permissions) required**: User must be the reporter or an Atlassian Connect app. * Post feedback */ postFeedbackRaw(requestParameters: PostFeedbackRequest): Promise<runtime.ApiResponse<CSATFeedbackFullDTO>>; /** * This method adds a feedback on an request using it\'s `requestKey` or `requestId` **[Permissions](#permissions) required**: User must be the reporter or an Atlassian Connect app. * Post feedback */ postFeedback(requestParameters: PostFeedbackRequest): Promise<CSATFeedbackFullDTO>; /** * This method removes participants from a customer request. **[Permissions](#permissions) required**: Permission to manage participants on the customer request. * Remove request participants */ removeRequestParticipantsRaw(requestParameters: RemoveRequestParticipantsRequest): Promise<runtime.ApiResponse<PagedDTOUserDTO>>; /** * This method removes participants from a customer request. **[Permissions](#permissions) required**: Permission to manage participants on the customer request. * Remove request participants */ removeRequestParticipants(requestParameters: RemoveRequestParticipantsRequest): Promise<PagedDTOUserDTO>; /** * This method subscribes the user to receiving notifications from a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Subscribe */ subscribeRaw(requestParameters: SubscribeRequest): Promise<runtime.ApiResponse<void>>; /** * This method subscribes the user to receiving notifications from a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Subscribe */ subscribe(requestParameters: SubscribeRequest): Promise<void>; /** * This method unsubscribes the user from notifications from a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Unsubscribe */ unsubscribeRaw(requestParameters: UnsubscribeRequest): Promise<runtime.ApiResponse<void>>; /** * This method unsubscribes the user from notifications from a customer request. **[Permissions](#permissions) required**: Permission to view the customer request. * Unsubscribe */ unsubscribe(requestParameters: UnsubscribeRequest): Promise<void>; }