export type CreateApiV1OrganizationsOrganizationIdInterventionBundlePlanPromoteArgs = {organizationId: string, body: {bundle_id: string, action_keys: Array, allow_partial?: boolean | undefined}}; export type CreateApiV1OrganizationsOrganizationIdInterventionBundlePlanPromoteOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Promote selected intervention bundle actions into receipts * * POST /v1/organizations/{organizationId}/intervention-bundle-plan/promote */ export const createApiV1OrganizationsOrganizationIdInterventionBundlePlanPromote = async (args: CreateApiV1OrganizationsOrganizationIdInterventionBundlePlanPromoteArgs, options?: CreateApiV1OrganizationsOrganizationIdInterventionBundlePlanPromoteOptions) => { const {baseUrl = "https://api.printhiv3d.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/organizations/${encodeURIComponent(String(args.organizationId))}/intervention-bundle-plan/promote${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 };