export type DeleteApiV2CompanyCompanyIdExternalUserMappingsIdentifierArgs = {'x-api-version'?: string | undefined, 'x-company-guid'?: string | undefined, company_id: number, identifier: string, location_id?: number | undefined}; export type DeleteApiV2CompanyCompanyIdExternalUserMappingsIdentifierOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete External User Mapping * * DELETE /v2/company/{company_id}/external_user_mappings/{identifier} * * Also accepts auth: cookieAuth */ export const deleteApiV2CompanyCompanyIdExternalUserMappingsIdentifier = async (args: DeleteApiV2CompanyCompanyIdExternalUserMappingsIdentifierArgs, options?: DeleteApiV2CompanyCompanyIdExternalUserMappingsIdentifierOptions) => { const {baseUrl = "https://api.7shifts.com", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-api-version'] != null) headers.set("x-api-version", String(args['x-api-version'])) if (args['x-company-guid'] != null) headers.set("x-company-guid", String(args['x-company-guid'])) if (args.location_id != null) query.append("location_id", String(args.location_id)) if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/company/${encodeURIComponent(String(args.company_id))}/external_user_mappings/${encodeURIComponent(String(args.identifier))}${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 };