export type MAMPolicyAppOrGroupIdProperties = {url: string}; export type MAMPolicyAppIdOrGroupIdPayload = {properties?: MAMPolicyAppOrGroupIdProperties | undefined}; export type UpdateApiProvidersMicrosoftIntuneLocationsHostNameIosPoliciesPolicyNameAppsAppNameArgs = {hostName: string, policyName: string, appName: string, 'api-version': string, body: MAMPolicyAppIdOrGroupIdPayload}; export type UpdateApiProvidersMicrosoftIntuneLocationsHostNameIosPoliciesPolicyNameAppsAppNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add app to an iOSMAMPolicy. * * PUT /providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/apps/{appName} */ export const updateApiProvidersMicrosoftIntuneLocationsHostNameIosPoliciesPolicyNameAppsAppName = async (args: UpdateApiProvidersMicrosoftIntuneLocationsHostNameIosPoliciesPolicyNameAppsAppNameArgs, options?: UpdateApiProvidersMicrosoftIntuneLocationsHostNameIosPoliciesPolicyNameAppsAppNameOptions) => { const {baseUrl = "https://management.azure.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['api-version'] != null) query.append("api-version", String(args['api-version'])) const url = `${baseUrl.replace(/\/+$/, '')}/providers/Microsoft.Intune/locations/${encodeURIComponent(String(args.hostName))}/iosPolicies/${encodeURIComponent(String(args.policyName))}/apps/${encodeURIComponent(String(args.appName))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };