export type BetConstructSSOCoreEnumsIPRuleType = 0 | 1; export type BetConstructSSOAuthAPIViewModelsUserIpRuleBulkAddingModel = {emails: Array, ipRuleType: BetConstructSSOCoreEnumsIPRuleType, ips: Array}; export type CreateApiV1ManagementsUsersIpRulesArgs = {body: BetConstructSSOAuthAPIViewModelsUserIpRuleBulkAddingModel}; export type CreateApiV1ManagementsUsersIpRulesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /V1/managements/users/ipRules */ export const createApiV1ManagementsUsersIpRules = async (args: CreateApiV1ManagementsUsersIpRulesArgs, options: CreateApiV1ManagementsUsersIpRulesOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/V1/managements/users/ipRules${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };