import type { ApiClient } from "@promobase/sdk-runtime"; import { Cursor } from "@promobase/sdk-runtime"; import { metaPagination } from "../../pagination.ts"; import type { AppPublisherFields } from "./app-publisher.ts"; import type { WebPublisherFields } from "./web-publisher.ts"; export interface PublisherBlockListFields { app_publishers: AppPublisherFields[]; business_owner_id: string; id: string; is_auto_blocking_on: boolean; is_eligible_at_campaign_level: boolean; last_update_time: string; last_update_user: string; name: string; owner_ad_account_id: string; web_publishers: WebPublisherFields[]; } export interface PublisherBlockListCreateAppendPublisherUrlsParams { publisher_urls: string[]; [key: string]: unknown; } export interface PublisherBlockListListPagedWebPublishersParams { draft_id?: string; [key: string]: unknown; } export interface PublisherBlockListUpdateParams { spec?: Record; [key: string]: unknown; } export function publisherBlockListNode(client: ApiClient, id: string) { return { __path: id, __brand: undefined as unknown as PublisherBlockListFields, get: (opts: { fields: F; params?: Record }) => client.get>(`${id}`, opts), update: (params: PublisherBlockListUpdateParams) => client.post(`${id}`, params as Record), delete: () => client.delete(`${id}`, {}), createAppendPublisherUrl: (params: PublisherBlockListCreateAppendPublisherUrlsParams) => client.post>(`${id}/append_publisher_urls`, params as Record), pagedWebPublishers: (opts: { fields: F; params?: PublisherBlockListListPagedWebPublishersParams }) => new Cursor>(client, `${id}/paged_web_publishers`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), }; }