export type BetConstructSSOAuthAPIViewModelsCreateViewModelsUserGroupIpRuleBulkAddModel = {ips?: (Array | null) | undefined}; export type CreateApiV1ManagementsUserGroupsUserGroupIdIpRulesArgs = {userGroupId: number, body: BetConstructSSOAuthAPIViewModelsCreateViewModelsUserGroupIpRuleBulkAddModel}; export type CreateApiV1ManagementsUserGroupsUserGroupIdIpRulesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /V1/managements/userGroups/{userGroupId}/ipRules */ export const createApiV1ManagementsUserGroupsUserGroupIdIpRules = async (args: CreateApiV1ManagementsUserGroupsUserGroupIdIpRulesArgs, options: CreateApiV1ManagementsUserGroupsUserGroupIdIpRulesOptions) => { 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/userGroups/${encodeURIComponent(String(args.userGroupId))}/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 };