export type EmissionsSourceID = string; export type DeleteApiV1OrganizationEmissionsSourcesIdArgs = {id: EmissionsSourceID}; export type DeleteApiV1OrganizationEmissionsSourcesIdOptions = {baseUrl?: string | undefined, OAuth2ClientCredentialsProduction?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an emissions source * * DELETE /v1/organization/emissions_sources/{id} * * Also accepts auth: OAuth2AuthCodeProduction */ export const deleteApiV1OrganizationEmissionsSourcesId = async (args: DeleteApiV1OrganizationEmissionsSourcesIdArgs, options?: DeleteApiV1OrganizationEmissionsSourcesIdOptions) => { const {baseUrl = "https://api.sinai.com", fetch: fetchFn = fetch, OAuth2ClientCredentialsProduction} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2ClientCredentialsProduction !== undefined) headers.set('authorization', `Bearer ${OAuth2ClientCredentialsProduction}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/organization/emissions_sources/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };