export type MAMPolicyAppOrGroupIdProperties = {url: string}; export type MAMPolicyAppIdOrGroupIdPayload = {properties?: MAMPolicyAppOrGroupIdProperties | undefined}; export type UpdateApiProvidersMicrosoftIntuneLocationsHostNameAndroidPoliciesPolicyNameGroupsGroupIdArgs = {hostName: string, policyName: string, groupId: string, 'api-version': string, body: MAMPolicyAppIdOrGroupIdPayload}; export type UpdateApiProvidersMicrosoftIntuneLocationsHostNameAndroidPoliciesPolicyNameGroupsGroupIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add group to an AndroidMAMPolicy. * * PUT /providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/groups/{groupId} */ export const updateApiProvidersMicrosoftIntuneLocationsHostNameAndroidPoliciesPolicyNameGroupsGroupId = async (args: UpdateApiProvidersMicrosoftIntuneLocationsHostNameAndroidPoliciesPolicyNameGroupsGroupIdArgs, options?: UpdateApiProvidersMicrosoftIntuneLocationsHostNameAndroidPoliciesPolicyNameGroupsGroupIdOptions) => { 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))}/androidPolicies/${encodeURIComponent(String(args.policyName))}/groups/${encodeURIComponent(String(args.groupId))}${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 };