export type GetApiResourcesConfigurationsV1RestrictionsIpArgs = {_limit?: number | undefined, _offset?: number | undefined, _filter?: string | undefined}; export type GetApiResourcesConfigurationsV1RestrictionsIpOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get all IP restrictions * * GET /resources/configurations/v1/restrictions/ip */ export const getApiResourcesConfigurationsV1RestrictionsIp = async (args: GetApiResourcesConfigurationsV1RestrictionsIpArgs, options?: GetApiResourcesConfigurationsV1RestrictionsIpOptions) => { const {baseUrl = "http://localhost:8181", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args._limit != null) query.append("_limit", String(args._limit)) if (args._offset != null) query.append("_offset", String(args._offset)) if (args._filter != null) query.append("_filter", String(args._filter)) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/resources/configurations/v1/restrictions/ip${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 };