import { BaseResource } from '@gitbeaker/requester-utils'; import { RequestHelper, endpoint } from '../infrastructure'; import type { GitlabAPIResponse, PaginationRequestOptions, PaginationTypes, ShowExpanded, Sudo, } from '../infrastructure'; export interface PipelineVariableSchema extends Record { key: string; variable_type?: string; value: string; } export class PipelineScheduleVariables extends BaseResource { all( projectId: string | number, pipelineScheduleId: number, options?: Sudo & ShowExpanded & PaginationRequestOptions

, ): Promise> { return RequestHelper.get()( this, endpoint`projects/${projectId}/pipeline_schedules/${pipelineScheduleId}/variables`, options, ); } create( projectId: string | number, pipelineScheduleId: number, key: string, value: string, options?: { variableType?: 'env_var' | 'file' } & Sudo & ShowExpanded, ): Promise> { return RequestHelper.post()( this, endpoint`projects/${projectId}/pipeline_schedules/${pipelineScheduleId}/variables`, { ...options, key, value, }, ); } edit( projectId: string | number, pipelineScheduleId: number, key: string, value: string, options?: { variableType?: 'env_var' | 'file' } & Sudo & ShowExpanded, ): Promise> { return RequestHelper.put()( this, endpoint`projects/${projectId}/pipeline_schedules/${pipelineScheduleId}/variables/${key}`, { ...options, value, }, ); } remove( projectId: string | number, pipelineScheduleId: number, key: string, options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.del()( this, endpoint`projects/${projectId}/pipeline_schedules/${pipelineScheduleId}/variables/${key}`, options, ); } }