-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathLicenseTemplates.ts
41 lines (37 loc) · 1.28 KB
/
LicenseTemplates.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
33
34
35
36
37
38
39
40
41
import type { BaseResourceOptions } from '@gitbeaker/requester-utils';
import { ResourceTemplates } from '../templates';
import type {
GitlabAPIResponse,
PaginationRequestOptions,
PaginationTypes,
ShowExpanded,
Sudo,
} from '../infrastructure';
export interface LicenseTemplateSchema extends Record<string, unknown> {
key: string;
name: string;
nickname?: string;
featured: boolean;
html_url: string;
source_url: string;
description: string;
conditions?: string[];
permissions?: string[];
limitations?: string[];
content: string;
}
export interface LicenseTemplates<C extends boolean = false> extends ResourceTemplates<C> {
all<E extends boolean = false, P extends PaginationTypes = 'offset'>(
options?: { popular?: boolean } & PaginationRequestOptions<P> & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<LicenseTemplateSchema[], C, E, P>>;
show<E extends boolean = false>(
key: string | number,
options?: { project?: string; fullName?: string } & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<LicenseTemplateSchema, C, E, void>>;
}
export class LicenseTemplates<C extends boolean = false> extends ResourceTemplates<C> {
constructor(options: BaseResourceOptions<C>) {
/* istanbul ignore next */
super('Licenses', options);
}
}