-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathApplicationPlanLimits.ts
87 lines (82 loc) · 2.61 KB
/
ApplicationPlanLimits.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { BaseResource } from '@gitbeaker/requester-utils';
import { RequestHelper } from '../infrastructure';
import type { Camelize, GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure';
export interface ApplicationPlanLimitSchema extends Record<string, unknown> {
ci_pipeline_size: number;
ci_active_jobs: number;
ci_active_pipelines: number;
ci_project_subscriptions: number;
ci_pipeline_schedules: number;
ci_needs_size_limit: number;
ci_registered_group_runners: number;
ci_registered_project_runners: number;
conan_max_file_size: number;
generic_packages_max_file_size: number;
helm_max_file_size: number;
maven_max_file_size: number;
npm_max_file_size: number;
nuget_max_file_size: number;
pypi_max_file_size: number;
terraform_module_max_file_size: number;
storage_size_limit: number;
}
export type ApplicationPlanLimitOptions = Partial<Camelize<ApplicationPlanLimitSchema>>;
export class ApplicationPlanLimits<C extends boolean = false> extends BaseResource<C> {
show<E extends boolean = false>(
options?: { planName?: string } & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<ApplicationPlanLimitSchema, C, E, void>> {
return RequestHelper.get<ApplicationPlanLimitSchema>()(
this,
'application/plan_limits',
options,
);
}
edit<E extends boolean = false>(
planName: string,
options: ApplicationPlanLimitOptions & Sudo & ShowExpanded<E> = {},
): Promise<GitlabAPIResponse<ApplicationPlanLimitSchema, C, E, void>> {
const {
ciPipelineSize,
ciActiveJobs,
ciActivePipelines,
ciProjectSubscriptions,
ciPipelineSchedules,
ciNeedsSizeLimit,
ciRegisteredGroupRunners,
ciRegisteredProjectRunners,
conanMaxFileSize,
genericPackagesMaxFileSize,
helmMaxFileSize,
mavenMaxFileSize,
npmMaxFileSize,
nugetMaxFileSize,
pypiMaxFileSize,
terraformModuleMaxFileSize,
storageSizeLimit,
...opts
} = options;
return RequestHelper.put<ApplicationPlanLimitSchema>()(this, 'application/plan_limits', {
...opts,
searchParams: {
planName,
ciPipelineSize,
ciActiveJobs,
ciActivePipelines,
ciProjectSubscriptions,
ciPipelineSchedules,
ciNeedsSizeLimit,
ciRegisteredGroupRunners,
ciRegisteredProjectRunners,
conanMaxFileSize,
genericPackagesMaxFileSize,
helmMaxFileSize,
mavenMaxFileSize,
npmMaxFileSize,
nugetMaxFileSize,
pypiMaxFileSize,
terraformModuleMaxFileSize,
storageSizeLimit,
},
});
}
}