export type GetApiGetesgprofileArgs = {lookup: string, language?: string | undefined}; export type GetApiGetesgprofileOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * ESG and sustainability profile for any company: ESG risk rating, environmental, social, and governance scores, carbon emissions by scope, net-zero target, renewable energy share, controversies, sustainability reporting frameworks, and a reference URL. For ESG investing, supplier due diligence, and sustainability reporting. * * GET /getesgprofile */ export const getApiGetesgprofile = async (args: GetApiGetesgprofileArgs, options?: GetApiGetesgprofileOptions) => { const {baseUrl = "https://api.interzoid.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.lookup != null) query.append("lookup", String(args.lookup)) if (args.language != null) query.append("language", String(args.language)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getesgprofile${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 };