export type UserProfileLoad = unknown; export type MemorySettings = {vuMb?: number | undefined}; export type UserProfileEngine = unknown; export type UserProfile = {id?: (string | null) | undefined, name?: (string | null) | undefined, virtualUserId?: string | undefined, providerId?: string | undefined, location?: string | undefined, load?: UserProfileLoad | undefined, memory?: MemorySettings | undefined, iterations?: number | undefined, engine?: UserProfileEngine | undefined}; export type Scenario = {id?: (string | null) | undefined, userId?: (string | null) | undefined, projectId?: (string | null) | undefined, name?: string | undefined, description?: (string | null) | undefined, userProfiles?: (Array | null) | undefined, mode?: ('STANDARD' | 'FUNCTIONAL' | null) | undefined, created?: (string | null) | undefined, lastModified?: (string | null) | undefined, tags?: (Array | null) | undefined}; export type CreateApiRuntimeScenariosMatchingPlansArgs = {body: Scenario}; export type CreateApiRuntimeScenariosMatchingPlansOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get subscriptions which can be used to run the given scenario * * POST /runtime/scenarios/matching-plans */ export const createApiRuntimeScenariosMatchingPlans = async (args: CreateApiRuntimeScenariosMatchingPlansArgs, options?: CreateApiRuntimeScenariosMatchingPlansOptions) => { const {baseUrl = "https://api.octoperf.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/runtime/scenarios/matching-plans${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 res.blob() };