export type CreateApiApiV2OrganizationOrganizationIdGroupsArgs = {organization_id: string, body: {name?: string | undefined, security_policy?: ({frequency?: string | undefined, ignore?: Array | undefined, jira_project_key?: string | undefined, notify_on_failure?: boolean | undefined, raise_tickets?: boolean | undefined, scanners?: Array<{[key: string]: unknown}> | undefined, tags?: Array | undefined, testing?: boolean | undefined, threshold?: ({HIGH?: number | undefined, MEDIUM?: number | undefined, LOW?: number | undefined, total?: number | undefined}) | undefined, ticket_body?: string | undefined, ticket_integration?: string | undefined, ticket_title?: string | undefined}) | undefined}}; export type CreateApiApiV2OrganizationOrganizationIdGroupsOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create Group * * POST /api/v2/organization/{organization_id}/groups */ export const createApiApiV2OrganizationOrganizationIdGroups = async (args: CreateApiApiV2OrganizationOrganizationIdGroupsArgs, options?: CreateApiApiV2OrganizationOrganizationIdGroupsOptions) => { const {baseUrl = "https://aquilax.ai", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.organization_id != null) query.append("organization_id", String(args.organization_id)) if (ApiKeyAuth !== undefined) headers.set("X-AX-KEY", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/organization/${encodeURIComponent(String(args.organization_id))}/groups${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 };