forked from jdalrymple/gitbeaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSidekiqQueues.ts
32 lines (29 loc) · 968 Bytes
/
SidekiqQueues.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { BaseResource } from '@gitbeaker/requester-utils';
import { RequestHelper, endpoint } from '../infrastructure';
import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure';
export interface SidekiqQueueStatus extends Record<string, unknown> {
completed: boolean;
deleted_jobs: number;
queue_size: number;
}
export type RemoveSidekiqQueueOptions = {
user?: string;
project?: string;
rootNamespace?: string;
subscriptionPlan?: string;
callerId?: string;
featureCategory?: string;
workerClass?: string;
};
export class SidekiqQueues<C extends boolean = false> extends BaseResource<C> {
remove<E extends boolean = false>(
queueName: string,
options?: RemoveSidekiqQueueOptions & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<SidekiqQueueStatus, C, E, void>> {
return RequestHelper.get<SidekiqQueueStatus>()(
this,
endpoint`admin/sidekiq/queues/${queueName}`,
options,
);
}
}