import { APIResource } from "../../core/resource.js"; import * as Shared from "../shared.js"; import * as AccountsAPI from "../accounts/accounts.js"; import * as MessagesAPI from "./messages.js"; import { MessageRedactParams, MessageRedactResponse, Messages } from "./messages.js"; import { APIPromise } from "../../core/api-promise.js"; import { PagePromise, PylonCursorPage, type PylonCursorPageParams, PylonSearchPage, type PylonSearchPageParams } from "../../core/pagination.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Issues extends APIResource { messages: MessagesAPI.Messages; /** * Create a new issue */ create(body: IssueCreateParams, options?: RequestOptions): APIPromise; /** * Get an issue by its ID/number */ retrieve(id: string, options?: RequestOptions): APIPromise; /** * Update an existing issue */ update(id: string, body: IssueUpdateParams, options?: RequestOptions): APIPromise; /** * Get a list of issues */ list(query: IssueListParams, options?: RequestOptions): PagePromise; /** * Delete an existing issue */ delete(id: string, options?: RequestOptions): APIPromise; /** * Search for issues by a given filter */ search(body: IssueSearchParams, options?: RequestOptions): PagePromise; /** * Snooze an issue */ snooze(id: string, body: IssueSnoozeParams, options?: RequestOptions): APIPromise; } export type IssuesPylonCursorPage = PylonCursorPage; export type IssuesPylonSearchPage = PylonSearchPage; export interface Issue { id: string; created_at: string; number: number; source: 'slack' | 'email' | 'chat' | 'api' | 'microsoft_teams' | 'discord'; state: string; type: 'Conversation' | 'Triage'; account?: Issue.Account; assignee?: AccountsAPI.UserReference; body_html?: string; business_hours_first_response_seconds?: number; business_hours_resolution_seconds?: number; chat_widget_info?: Issue.ChatWidgetInfo; csat_responses?: Array; custom_fields?: { [key: string]: Shared.CustomFieldValue; }; customer_portal_visible?: boolean; external_issues?: Array; first_response_seconds?: number; first_response_time?: string; latest_message_time?: string; link?: string; number_of_touches?: number; requester?: AccountsAPI.UserReference; resolution_seconds?: number; resolution_time?: string; slack?: Issue.Slack; snoozed_until_time?: string; tags?: Array; team?: Issue.Team; title?: string; } export declare namespace Issue { interface Account { id?: string; } interface ChatWidgetInfo { page_url?: string; } interface CsatResponse { comment?: string; score?: number; } interface ExternalIssue { external_id?: string; link?: string; source?: string; } interface Slack { channel_id?: string; message_ts?: string; } interface Team { id?: string; } } export interface IssueResponse { data?: Issue; request_id?: string; } export interface IssueDeleteResponse { request_id?: string; } export interface IssueCreateParams { /** * The title of the issue */ title: string; /** * The account that this issue belongs to */ account_id?: string; /** * The user the issue should be assigned to */ assignee_id?: string; /** * An array of attachment URLs to attach to this issue */ attachment_urls?: Array; /** * The HTML content of the body of the issue */ body_html?: string; /** * Timestamp of when the issue was created (RFC3339) */ created_at?: string; /** * An array of custom fields to be used on this issue */ custom_fields?: Array; destination_metadata?: IssueCreateParams.DestinationMetadata; /** * The priority of the issue */ priority?: 'urgent' | 'high' | 'medium' | 'low'; /** * The URL of an avatar of the requester */ requester_avatar_url?: string; /** * The email of the user that this issue is on behalf of */ requester_email?: string; /** * The requester that this issue is on behalf of */ requester_id?: string; /** * The full name of the user that this issue is on behalf of */ requester_name?: string; /** * An array of strings to use as tags on this issue */ tags?: Array; /** * The ID of the team this issue should be assigned to */ team_id?: string; } export declare namespace IssueCreateParams { interface DestinationMetadata { /** * How communication will be delivered to the customer */ destination?: 'slack' | 'email' | 'chat' | 'internal'; /** * Email address for email destination */ email?: string; /** * BCC email addresses */ email_bccs?: Array; /** * CC email addresses */ email_ccs?: Array; } } export interface IssueUpdateParams { /** * The ID of the user who should be assigned to this issue */ assignee_id?: string; /** * An array of custom fields to be used on this issue */ custom_fields?: Array; /** * Whether the issue should be visible in the customer portal */ customer_portal_visible?: boolean; /** * The ID of the requester that this issue is on behalf of */ requester_id?: string; /** * @deprecated Deprecated. Use requester_id instead */ requestor_id?: string; /** * The state this issue should be moved to */ state?: 'new' | 'waiting_on_you' | 'waiting_on_customer' | 'on_hold' | 'closed'; /** * An array of strings to use as tags on this issue */ tags?: Array; /** * The ID of the team this issue should be assigned to */ team_id?: string; } export interface IssueListParams extends PylonCursorPageParams { /** * The end time in RFC3339 format. Must be within 30 days of start_time */ end_time: string; /** * The start time in RFC3339 format */ start_time: string; } export interface IssueSearchParams extends PylonSearchPageParams { } export interface IssueSnoozeParams { /** * RFC3339 timestamp of when to unsnooze the issue */ snooze_until_time: string; } export declare namespace Issues { export { type Issue as Issue, type IssueResponse as IssueResponse, type IssueDeleteResponse as IssueDeleteResponse, type IssuesPylonCursorPage as IssuesPylonCursorPage, type IssuesPylonSearchPage as IssuesPylonSearchPage, type IssueCreateParams as IssueCreateParams, type IssueUpdateParams as IssueUpdateParams, type IssueListParams as IssueListParams, type IssueSearchParams as IssueSearchParams, type IssueSnoozeParams as IssueSnoozeParams, }; export { Messages as Messages, type MessageRedactResponse as MessageRedactResponse, type MessageRedactParams as MessageRedactParams, }; } //# sourceMappingURL=issues.d.ts.map