export type GetApiV1PartnerCompaniesCompanyIdArgs = {companyId: string}; export type GetApiV1PartnerCompaniesCompanyIdOptions = {baseUrl?: string | undefined, PartnerApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get a company * * GET /v1/partner/companies/{companyId} */ export const getApiV1PartnerCompaniesCompanyId = async (args: GetApiV1PartnerCompaniesCompanyIdArgs, options?: GetApiV1PartnerCompaniesCompanyIdOptions) => { const {baseUrl = "https://api.test.doola.com", fetch: fetchFn = fetch, PartnerApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (PartnerApiKey !== undefined) headers.set("Authorization", PartnerApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/partner/companies/${encodeURIComponent(String(args.companyId))}${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 res.blob() };