node-ovh-ts
Version:
OVH API wrapper library for TypeScript
1 lines • 3.77 kB
Source Map (JSON)
{"version":3,"sources":["../src/handlers/Support.ts"],"sourcesContent":["/* WARNING: This file is auto-generated . Do not edit manually. */\n\nimport { SupportNewMessageInfo } from '../models/SupportNewMessageInfo';\nimport { SupportTicketImpactUrgencyEnum } from '../models/SupportTicketImpactUrgencyEnum';\nimport { SupportTicketProductEnum } from '../models/SupportTicketProductEnum';\nimport { SupportTicket } from '../models/SupportTicket';\nimport { SupportTicketCategoryEnum } from '../models/SupportTicketCategoryEnum';\nimport { SupportMessage } from '../models/SupportMessage';\nimport { SupportTicketTypeEnum } from '../models/SupportTicketTypeEnum';\nimport { SupportTicketSubCategoryEnum } from '../models/SupportTicketSubCategoryEnum';\nimport { SupportTicketStatusEnum } from '../models/SupportTicketStatusEnum';\nimport OVHBase from '../ovh';\n\nclass SupportHandler {\n ovh: OVHBase;\n\n constructor(ovh: OVHBase) {\n this.ovh = ovh;\n }\n\n /** List support tickets identifiers for this service */\n listTickets = (): Promise<number[]> => {\n return this.ovh.request('GET', '/support/tickets');\n };\n\n /** Create a new ticket */\n createTickets = (body: {\n body: string;\n category?: SupportTicketCategoryEnum;\n impact?: SupportTicketImpactUrgencyEnum;\n product?: SupportTicketProductEnum;\n serviceName?: string;\n subcategory?: SupportTicketSubCategoryEnum;\n subject: string;\n type?: SupportTicketTypeEnum;\n urgency?: SupportTicketImpactUrgencyEnum;\n }): Promise<SupportNewMessageInfo> => {\n return this.ovh.request('POST', '/support/tickets/create', body);\n };\n\n /** Get ticket */\n getTicketsByTicketId = (ticketId: number): Promise<SupportTicket> => {\n return this.ovh.request('GET', `/support/tickets/${ticketId}`);\n };\n\n /** Checks whether ticket can be scored */\n checkTicketsCanBeScoredByTicketId = (ticketId: number): Promise<boolean> => {\n return this.ovh.request('GET', `/support/tickets/${ticketId}/canBeScored`);\n };\n\n /** Close ticket */\n postTicketsCloseByTicketId = (ticketId: number): Promise<void> => {\n return this.ovh.request('POST', `/support/tickets/${ticketId}/close`);\n };\n\n /** Get ticket messages */\n getTicketsMessagesByTicketId = (ticketId: number): Promise<SupportMessage[]> => {\n return this.ovh.request('GET', `/support/tickets/${ticketId}/messages`);\n };\n\n /** Reopen a ticket */\n postTicketsReopenByTicketId = (ticketId: number, body: { body: string }): Promise<void> => {\n return this.ovh.request('POST', `/support/tickets/${ticketId}/reopen`, body);\n };\n\n /** Reply to ticket */\n postTicketsReplyByTicketId = (ticketId: number, body: { body: string }): Promise<void> => {\n return this.ovh.request('POST', `/support/tickets/${ticketId}/reply`, body);\n };\n\n /** Set ticket score */\n postTicketsScoreByTicketId = (\n ticketId: number,\n body: { score: string; scoreComment?: string }\n ): Promise<void> => {\n return this.ovh.request('POST', `/support/tickets/${ticketId}/score`, body);\n };\n}\n\nexport { SupportHandler };\n"],"mappings":"AAaA,IAAMA,EAAN,KAAqB,CAGnB,YAAYC,EAAc,CAK1B,iBAAc,IACL,KAAK,IAAI,QAAQ,MAAO,kBAAkB,EAInD,mBAAiBC,GAWR,KAAK,IAAI,QAAQ,OAAQ,0BAA2BA,CAAI,EAIjE,0BAAwBC,GACf,KAAK,IAAI,QAAQ,MAAO,oBAAoBA,GAAU,EAI/D,uCAAqCA,GAC5B,KAAK,IAAI,QAAQ,MAAO,oBAAoBA,eAAsB,EAI3E,gCAA8BA,GACrB,KAAK,IAAI,QAAQ,OAAQ,oBAAoBA,SAAgB,EAItE,kCAAgCA,GACvB,KAAK,IAAI,QAAQ,MAAO,oBAAoBA,YAAmB,EAIxE,iCAA8B,CAACA,EAAkBD,IACxC,KAAK,IAAI,QAAQ,OAAQ,oBAAoBC,WAAmBD,CAAI,EAI7E,gCAA6B,CAACC,EAAkBD,IACvC,KAAK,IAAI,QAAQ,OAAQ,oBAAoBC,UAAkBD,CAAI,EAI5E,gCAA6B,CAC3BC,EACAD,IAEO,KAAK,IAAI,QAAQ,OAAQ,oBAAoBC,UAAkBD,CAAI,EA1D1E,KAAK,IAAMD,CACb,CA2DF","names":["SupportHandler","ovh","body","ticketId"]}