export type CreateApiV01PublicAppsOwnerNameAppNameInstallAnalyticsArgs = {owner_name: string, app_name: string, body: {releases?: Array<{release_id: number, distribution_group_id: string, user_id: string}> | undefined}}; export type CreateApiV01PublicAppsOwnerNameAppNameInstallAnalyticsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Notify download(s) for the provided distribution release(s). * * POST /v0.1/public/apps/{owner_name}/{app_name}/install_analytics */ export const createApiV01PublicAppsOwnerNameAppNameInstallAnalytics = async (args: CreateApiV01PublicAppsOwnerNameAppNameInstallAnalyticsArgs, options?: CreateApiV01PublicAppsOwnerNameAppNameInstallAnalyticsOptions) => { const {baseUrl = "https://api.appcenter.ms", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v0.1/public/apps/${encodeURIComponent(String(args.owner_name))}/${encodeURIComponent(String(args.app_name))}/install_analytics${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 };