export type CreateApiResourceTenantLocatorUiConfigsArgs = {tenantLocator: string, 'Content-Type': string, name: string, staticName: string, jurisdiction?: Array | undefined, body: BodyInit}; export type CreateApiResourceTenantLocatorUiConfigsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /resource/{tenantLocator}/uiConfigs */ export const createApiResourceTenantLocatorUiConfigs = async (args: CreateApiResourceTenantLocatorUiConfigsArgs, options: CreateApiResourceTenantLocatorUiConfigsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.name != null) query.append("name", String(args.name)) if (args.staticName != null) query.append("staticName", String(args.staticName)) for (const item of args.jurisdiction ?? []) query.append("jurisdiction", String(item)) const url = `${baseUrl.replace(/\/+$/, '')}/resource/${encodeURIComponent(String(args.tenantLocator))}/uiConfigs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };