export type JumpcloudMicrosoftMdmDownloadConfigFilesRequest = Record; export type CreateApiApiV2MicrosoftMdmConfigurationFilesArgs = {body: JumpcloudMicrosoftMdmDownloadConfigFilesRequest}; export type CreateApiApiV2MicrosoftMdmConfigurationFilesOptions = {baseUrl?: string | undefined, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * This endpoint provides a zipped configuration file intended for use with Microsoft Configuration Designer to create a Provisioning Package (PPKG) for bulk MDM enrollment. * * POST /api/v2/microsoft-mdm/configuration-files */ export const createApiApiV2MicrosoftMdmConfigurationFiles = async (args: CreateApiApiV2MicrosoftMdmConfigurationFilesArgs, options?: CreateApiApiV2MicrosoftMdmConfigurationFilesOptions) => { const {baseUrl = "https://console.jumpcloud.com", fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/zip") if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/microsoft-mdm/configuration-files${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() };