export type GetApiV1PartnersPartnerIdArgs = {partnerId: string}; export type GetApiV1PartnersPartnerIdOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Buscar sócio por ID * * GET /v1/partners/{partnerId} */ export const getApiV1PartnersPartnerId = async (args: GetApiV1PartnersPartnerIdArgs, options?: GetApiV1PartnersPartnerIdOptions) => { const {baseUrl = "https://api.nibo.com.br/empresas", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (sec0 !== undefined) headers.set("apitoken", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/v1/partners/${encodeURIComponent(String(args.partnerId))}${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 (await res.json()) as unknown };