export type GetApiContextDevBrandRetrieveByNameArgs = {name: string, maxSpeed?: boolean | undefined, country_gl?: string | undefined, timeoutMS?: number | undefined}; export type GetApiContextDevBrandRetrieveByNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve brand information using a company name. This endpoint searches for the company by name and returns its brand data. * * GET /context-dev/brand/retrieve-by-name */ export const getApiContextDevBrandRetrieveByName = async (args: GetApiContextDevBrandRetrieveByNameArgs, options?: GetApiContextDevBrandRetrieveByNameOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.name != null) query.append("name", String(args.name)) if (args.maxSpeed != null) query.append("maxSpeed", String(args.maxSpeed)) if (args.country_gl != null) query.append("country_gl", String(args.country_gl)) if (args.timeoutMS != null) query.append("timeoutMS", String(args.timeoutMS)) const url = `${baseUrl.replace(/\/+$/, '')}/context-dev/brand/retrieve-by-name${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 undefined };