export type IMEIConfigCreate3Model = {IMEI?: string | undefined, VehicleId?: number | undefined, SerialNumber?: string | undefined, IMEIDeviceType?: (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 255) | undefined, OrganizationNodeId?: number | undefined}; export type CreateApiV1ResourceownerImeiconfigs3Args = {body: IMEIConfigCreate3Model}; export type CreateApiV1ResourceownerImeiconfigs3Options = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates a new IMEIConfig and associates it with vehicle * * POST /v1/resourceowner/imeiconfigs3 */ export const createApiV1ResourceownerImeiconfigs3 = async (args: CreateApiV1ResourceownerImeiconfigs3Args, options: CreateApiV1ResourceownerImeiconfigs3Options) => { const {baseUrl, fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/resourceowner/imeiconfigs3${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 };