export type Icon = 'search' | 'star' | 'alert' | 'check' | 'bolt' | 'bookmark' | 'flag' | 'heart'; export type Model40 = {name: string, criteria: string, icon?: Icon | undefined}; export type UpdateApiV1AccountsAccountSidBucketsBucketSidStreamViewsStreamViewSidArgs = {accountSid: string, bucketSid: string, streamViewSid: string, body: Model40}; export type UpdateApiV1AccountsAccountSidBucketsBucketSidStreamViewsStreamViewSidOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the details of a single stream view * * PUT /v1/accounts/{accountSid}/buckets/{bucketSid}/streamViews/{streamViewSid} */ export const updateApiV1AccountsAccountSidBucketsBucketSidStreamViewsStreamViewSid = async (args: UpdateApiV1AccountsAccountSidBucketsBucketSidStreamViewsStreamViewSidArgs, options?: UpdateApiV1AccountsAccountSidBucketsBucketSidStreamViewsStreamViewSidOptions) => { const {baseUrl = "https://api.apitraffic.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/accounts/${encodeURIComponent(String(args.accountSid))}/buckets/${encodeURIComponent(String(args.bucketSid))}/streamViews/${encodeURIComponent(String(args.streamViewSid))}${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 (await res.json()) as unknown };