22 lines
525 B
TypeScript
22 lines
525 B
TypeScript
import type { IGitLabProtectedBranch } from './gitlab.interfaces.js';
|
|
|
|
export class GitLabProtectedBranch {
|
|
public readonly id: number;
|
|
public readonly name: string;
|
|
public readonly allowForcePush: boolean;
|
|
|
|
constructor(raw: IGitLabProtectedBranch) {
|
|
this.id = raw.id;
|
|
this.name = raw.name || '';
|
|
this.allowForcePush = raw.allow_force_push ?? false;
|
|
}
|
|
|
|
toJSON(): IGitLabProtectedBranch {
|
|
return {
|
|
id: this.id,
|
|
name: this.name,
|
|
allow_force_push: this.allowForcePush,
|
|
};
|
|
}
|
|
}
|