export type GetApiPipelineAccountLocalDeployConfigArgs = {deployment_group?: string | undefined}; export type GetApiPipelineAccountLocalDeployConfigOptions = {baseUrl?: string | undefined, PipelineServiceKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get client config * * GET /pipeline/account/local-deploy/config */ export const getApiPipelineAccountLocalDeployConfig = async (args: GetApiPipelineAccountLocalDeployConfigArgs, options?: GetApiPipelineAccountLocalDeployConfigOptions) => { const {baseUrl = "https://api.mezmo.com/v3", fetch: fetchFn = fetch, PipelineServiceKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.deployment_group != null) query.append("deployment_group", String(args.deployment_group)) if (PipelineServiceKey !== undefined) headers.set("Authorization", PipelineServiceKey) const url = `${baseUrl.replace(/\/+$/, '')}/pipeline/account/local-deploy/config${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };