export type GetApiV1AssetsAssetIdWatermarkMatchesArgs = {'Auth-Token': string, 'App-ID': string, asset_id: string, proxy_id?: string | undefined, version_id?: string | undefined}; export type GetApiV1AssetsAssetIdWatermarkMatchesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Get all ProxyContainerByUser records for an asset's proxies, * * GET /v1/assets/{asset_id}/watermark_matches/ */ export const getApiV1AssetsAssetIdWatermarkMatches = async (args: GetApiV1AssetsAssetIdWatermarkMatchesArgs, options: GetApiV1AssetsAssetIdWatermarkMatchesOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args.proxy_id != null) query.append("proxy_id", String(args.proxy_id)) if (args.version_id != null) query.append("version_id", String(args.version_id)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/assets/${encodeURIComponent(String(args.asset_id))}/watermark_matches/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };