import { BaseResource } from '@gitbeaker/requester-utils'; import { RequestHelper, endpoint } from '../infrastructure'; import type { GitlabAPIResponse, PaginationRequestOptions, PaginationTypes, ShowExpanded, Sudo, } from '../infrastructure'; export interface CondensedNamespaceSchema extends Record { id: number; name: string; path: string; kind: string; full_path: string; parent_id?: number | null; avatar_url: string | null; web_url: string; } export interface NamespaceSchema extends CondensedNamespaceSchema { members_count_with_descendants: number; billable_members_count: number; plan: string; trial_ends_on?: string; trial: boolean; } export interface NamespaceExistsSchema extends Record { exists: boolean; suggests: string[]; } export class Namespaces extends BaseResource { all( options?: { search?: string; ownedOnly?: string; topLevelOnly?: boolean; } & PaginationRequestOptions

& Sudo & ShowExpanded, ): Promise> { return RequestHelper.get()(this, 'namespaces', options); } exists( namespace: string, options?: { parentId?: string } & Sudo & ShowExpanded, ): Promise> { return RequestHelper.get()( this, endpoint`namespaces/${namespace}/exists`, options, ); } show( namespaceId: string | number, options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.get()(this, endpoint`namespaces/${namespaceId}`, options); } }