import { CrowdinApi, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; /** * Webhooks allow you to collect information about events that happen in your Crowdin projects. * * You can select the request type, content type, and add a custom payload, which allows you to create integrations with other systems on your own. */ export declare class Webhooks extends CrowdinApi { /** * @requiredScope project.webhook:read * @param projectId project identifier * @param options optional pagination parameters for the request * @see https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.getMany */ listWebhooks(projectId: number, options?: PaginationOptions): Promise>; /** * @requiredScope project.webhook:read * @param projectId project identifier * @param limit maximum number of items to retrieve (default 25) * @param offset starting offset in the collection (default 0) * @deprecated optional parameters should be passed through an object * @see https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.getMany */ listWebhooks(projectId: number, limit?: number, offset?: number): Promise>; /** * @requiredScope project.webhook:write * @param projectId project identifier * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.post */ addWebhook(projectId: number, request: WebhooksModel.AddWebhookRequest): Promise>; /** * @requiredScope project.webhook:read * @param projectId project identifier * @param webhookId webhook identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.get */ getWebhook(projectId: number, webhookId: number): Promise>; /** * @requiredScope project.webhook:write * @param projectId project identifier * @param webhookId webhook identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.delete */ deleteWebhook(projectId: number, webhookId: number): Promise; /** * @requiredScope project.webhook:write * @param projectId project identifier * @param webhookId webhook identifier * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.patch */ editWebhook(projectId: number, webhookId: number, request: PatchRequest[]): Promise>; } export declare namespace WebhooksModel { interface Webhook { id: number; projectId: number; name: string; url: string | null; events: Event[]; headers: Record; payload: Record; isActive: boolean; batchingEnabled: boolean; requestType: RequestType; contentType: ContentType | null; createdAt: string; updatedAt: string; } interface AddWebhookRequest { name: string; url: string; events: Event[]; requestType: RequestType; isActive?: boolean; batchingEnabled?: boolean; contentType?: ContentType; headers?: Record; payload?: Record; } type ContentType = 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded'; type Event = 'file.added' | 'file.updated' | 'file.reverted' | 'file.deleted' | 'file.translated' | 'file.approved' | 'file.qa.finished' | 'project.translated' | 'project.approved' | 'project.qa.finished' | 'project.built' | 'preTranslation.completed' | 'translation.updated' | 'string.added' | 'string.updated' | 'string.deleted' | 'stringComment.created' | 'stringComment.updated' | 'stringComment.deleted' | 'stringComment.restored' | 'suggestion.added' | 'suggestion.updated' | 'suggestion.deleted' | 'suggestion.approved' | 'suggestion.disapproved' | 'task.added' | 'task.statusChanged' | 'task.updated' | 'task.deleted'; type RequestType = 'POST' | 'GET'; }