import type { Campaign, Contact, Newsroom, Pagination, Pitch, Query, SenderAddress, SortOrder, Story } from '../../types'; export type Ref = T['id'] | { id: T['id']; }; export interface Recipient { contact: Ref; email_address?: string; } export interface WriteRequest { sender_address?: Ref; recipient?: Recipient | null; subject?: string; /** JSON-serialized document in Prezly Content Format. */ content?: string; scheduled_date?: string | null; newsroom?: Ref | null; story?: Ref | null; story_alignment?: Campaign.StoryAlignment; story_appearance?: Campaign.StoryAppearance; story_header_footer?: Campaign.StoryHeaderFooter; is_open_tracking_enabled?: boolean; is_click_tracking_enabled?: boolean; } export type CreateRequest = WriteRequest; export type UpdateRequest = WriteRequest; export interface ListOptions { /** Number of pitches to return. Must not exceed 100. */ limit?: number; offset?: number; search?: string; query?: Query; sortOrder?: SortOrder | string; } export interface PitchPagination extends Pagination { offset: number; limit: number; } export interface ListResponse { pitches: Pitch[]; pagination: PitchPagination; sort: string; } export interface PitchWarning { field: 'recipient.email_address'; code: 'bounced' | 'required' | 'unsubscribed' | 'unsubscribed_from_all_communications'; message: string; } export interface PitchResponse { pitch: Pitch; warnings: PitchWarning[]; }