export type RepositoryId = string; export type RepositoryGroupsRequest = {groups: Array}; export type CreateApiV1RepositoriesRepositoryIdGroupsAddArgs = {repositoryId: RepositoryId, body: RepositoryGroupsRequest}; export type CreateApiV1RepositoriesRepositoryIdGroupsAddOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add Groups as Members on Repository * * POST /v1/repositories/{repositoryId}/groups/add * * Also accepts auth: OAuth2 */ export const createApiV1RepositoriesRepositoryIdGroupsAdd = async (args: CreateApiV1RepositoriesRepositoryIdGroupsAddArgs, options?: CreateApiV1RepositoriesRepositoryIdGroupsAddOptions) => { const {baseUrl = "https://api.lucid.co", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/repositories/${encodeURIComponent(String(args.repositoryId))}/groups/add${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };