export type UpdateApiV2PartitionPartitionIdAccountAccountIdMedia2IdArgs = {accountId: string, id: string, partitionId: string}; export type UpdateApiV2PartitionPartitionIdAccountAccountIdMedia2IdOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Choose hold music for an account * * PUT /v2/partition/{partitionId}/account/{accountId}/media_2/{id} */ export const updateApiV2PartitionPartitionIdAccountAccountIdMedia2Id = async (args: UpdateApiV2PartitionPartitionIdAccountAccountIdMedia2IdArgs, options?: UpdateApiV2PartitionPartitionIdAccountAccountIdMedia2IdOptions) => { const {baseUrl = "https://api.alianza.com", fetch: fetchFn = fetch, XAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (XAuthToken !== undefined) headers.set("X-AUTH-TOKEN", XAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/v2/partition/${encodeURIComponent(String(args.partitionId))}/account/${encodeURIComponent(String(args.accountId))}/media_2/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };