export type HelmGitRepositoryRequest = {url: string, branch?: string | undefined, root_path?: string | undefined, git_token_id?: (string | null) | undefined}; export type HelmDefaultValuesRequest = {source: {git_repository?: HelmGitRepositoryRequest | undefined} | {helm_repository?: ({repository?: (unknown | null) | undefined, chart_name?: string | undefined, chart_version?: string | undefined}) | undefined}}; export type CreateApiEnvironmentEnvironmentIdHelmDefaultValuesArgs = {environmentId: string, body: HelmDefaultValuesRequest}; export type CreateApiEnvironmentEnvironmentIdHelmDefaultValuesOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get helm default values * * POST /environment/{environmentId}/helmDefaultValues * * Also accepts auth: bearerAuth */ export const createApiEnvironmentEnvironmentIdHelmDefaultValues = async (args: CreateApiEnvironmentEnvironmentIdHelmDefaultValuesArgs, options?: CreateApiEnvironmentEnvironmentIdHelmDefaultValuesOptions) => { const {baseUrl = "https://api.qovery.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/plain") if (ApiKeyAuth !== undefined) headers.set("Authorization", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/environment/${encodeURIComponent(String(args.environmentId))}/helmDefaultValues${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 res.text() };