export type EDSChannelUpdate = {name?: string | undefined, supportedEventTypes?: Array | undefined, status?: ('active' | 'disabled') | undefined, maxRetries?: number | undefined, lastUpdatedBy?: string | undefined}; export type PatchApiV1DomainsDomainIdChannelsChannelIdArgs = {domainId: string, channelId: string, body: EDSChannelUpdate}; export type PatchApiV1DomainsDomainIdChannelsChannelIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update a channel * * PATCH /v1/domains/{domainId}/channels/{channelId} */ export const patchApiV1DomainsDomainIdChannelsChannelId = async (args: PatchApiV1DomainsDomainIdChannelsChannelIdArgs, options: PatchApiV1DomainsDomainIdChannelsChannelIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v1/domains/${encodeURIComponent(String(args.domainId))}/channels/${encodeURIComponent(String(args.channelId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 res.blob() };