import * as React$1 from "react";
//#region src/api-keys/interfaces/api-key.d.ts
export interface ApiKey {
  created_at: string;
  id: string;
  last_used_at: string | null;
  name: string;
}
//#endregion
//#region src/common/interfaces/attachment.interface.d.ts
/**
 * Attachment returned by the signed-URL endpoints:
 * - GET /emails/{id}/attachments
 * - GET /emails/{id}/attachments/{id}
 * - GET /emails/receiving/{id}/attachments
 * - GET /emails/receiving/{id}/attachments/{id}
 *
 * Not to be confused with InboundAttachment, which is the raw metadata
 * embedded inside GET /inbounds/{id} — no signed URL, nullable DB columns.
 */
export interface AttachmentData {
  id: string;
  filename?: string;
  size: number;
  content_type: string;
  content_disposition: 'inline' | 'attachment';
  content_id?: string;
  download_url: string;
  expires_at: string;
}
//#endregion
//#region src/common/interfaces/request-options.interface.d.ts
export interface RequestOptions {
  headers?: HeadersInit;
  signal?: AbortSignal;
}
//#endregion
//#region src/common/interfaces/delete-option.interface.d.ts
export interface DeleteOptions extends RequestOptions {}
//#endregion
//#region src/domains/interfaces/domain.d.ts
export type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1';
export type DomainCapabilityStatus = 'enabled' | 'disabled';
export interface DomainCapabilities {
  sending: DomainCapabilityStatus;
  receiving: DomainCapabilityStatus;
}
export type DomainNameservers = 'Amazon Route 53' | 'Cloudflare' | 'Digital Ocean' | 'GoDaddy' | 'Google Domains' | 'Namecheap' | 'Unidentified' | 'Vercel';
export type DomainRecordStatus = 'pending' | 'verified' | 'failed' | 'temporary_failure' | 'not_started';
export type DomainStatus = 'pending' | 'verified' | 'failed' | 'not_started' | 'partially_verified' | 'partially_failed';
export type DomainRecords = DomainSpfRecord | DomainDkimRecord | ReceivingRecord | TrackingRecord | TrackingCaaRecord;
export interface DomainSpfRecord {
  record: 'SPF';
  name: string;
  value: string;
  type: 'MX' | 'TXT' | 'CNAME';
  ttl: string;
  status: DomainRecordStatus;
  routing_policy?: string;
  priority?: number;
  proxy_status?: 'enable' | 'disable';
}
export interface DomainDkimRecord {
  record: 'DKIM';
  name: string;
  value: string;
  type: 'CNAME' | 'TXT';
  ttl: string;
  status: DomainRecordStatus;
  routing_policy?: string;
  priority?: number;
  proxy_status?: 'enable' | 'disable';
}
export interface ReceivingRecord {
  record: 'Receiving';
  name: string;
  value: string;
  type: 'MX';
  ttl: string;
  status: DomainRecordStatus;
  priority: number;
}
export interface TrackingRecord {
  record: 'Tracking';
  name: string;
  value: string;
  type: 'CNAME';
  ttl: string;
  status: DomainRecordStatus;
}
export interface TrackingCaaRecord {
  record: 'TrackingCAA';
  name: string;
  value: string;
  type: 'CAA';
  ttl: string;
  status: DomainRecordStatus;
}
export interface Domain {
  id: string;
  name: string;
  status: DomainStatus;
  created_at: string;
  region: DomainRegion;
  capabilities: DomainCapabilities;
  open_tracking?: boolean;
  click_tracking?: boolean;
  tracking_subdomain?: string;
}
//#endregion
//#region src/common/interfaces/domain-api-options.interface.d.ts
export interface DomainApiOptions {
  name: string;
  region?: string;
  custom_return_path?: string;
  capabilities?: Partial<DomainCapabilities>;
  open_tracking?: boolean;
  click_tracking?: boolean;
  tls?: 'enforced' | 'opportunistic';
  tracking_subdomain?: string;
}
//#endregion
//#region src/interfaces.d.ts
type RESEND_ERROR_CODE_KEY = 'invalid_idempotency_key' | 'validation_error' | 'missing_api_key' | 'restricted_api_key' | 'invalid_api_key' | 'not_found' | 'method_not_allowed' | 'invalid_idempotent_request' | 'concurrent_idempotent_requests' | 'invalid_attachment' | 'invalid_from_address' | 'invalid_access' | 'invalid_parameter' | 'invalid_region' | 'missing_required_field' | 'monthly_quota_exceeded' | 'daily_quota_exceeded' | 'rate_limit_exceeded' | 'security_error' | 'application_error' | 'internal_server_error';
type Response<T> = ({
  data: T;
  error: null;
} | {
  error: ErrorResponse;
  data: null;
}) & {
  headers: Record<string, string> | null;
};
type ErrorResponse = {
  message: string;
  statusCode: number | null;
  name: RESEND_ERROR_CODE_KEY;
};
type Tag$1 = {
  name: string;
  value: string;
};
//#endregion
//#region src/common/interfaces/email-api-options.interface.d.ts
export interface EmailApiAttachment {
  content?: string | Buffer;
  filename?: string | false | undefined;
  path?: string;
  content_type?: string;
  content_id?: string;
}
export interface EmailApiOptions {
  from?: string;
  to: string | string[];
  subject?: string;
  region?: string;
  headers?: Record<string, string>;
  html?: string;
  text?: string;
  bcc?: string | string[];
  cc?: string | string[];
  reply_to?: string | string[];
  topic_id?: string | null;
  scheduled_at?: string;
  tags?: Tag$1[];
  attachments?: EmailApiAttachment[];
  template?: {
    id: string;
    variables?: Record<string, string | number>;
  };
}
//#endregion
//#region src/common/interfaces/get-option.interface.d.ts
export interface GetOptions extends RequestOptions {
  query?: Record<string, unknown>;
}
//#endregion
//#region src/common/interfaces/idempotent-request.interface.d.ts
export interface IdempotentRequest {
  /**
   * Unique key that ensures the same operation is not processed multiple times.
   * Allows for safe retries without duplicating operations.
   * If provided, will be sent as the `Idempotency-Key` header.
   */
  idempotencyKey?: string;
}
//#endregion
//#region src/common/interfaces/pagination-options.interface.d.ts
export type PaginationOptions = {
  /**
   * Maximum number of items to return (1-100, default: 20)
   */
  limit?: number;
} & ({
  /**
   * Get items after this cursor (cannot be used with 'before')
   */
  after?: string;
  before?: never;
} | {
  /**
   * Get items before this cursor (cannot be used with 'after')
   */
  before?: string;
  after?: never;
});
export type PaginatedData<Data> = {
  object: 'list';
  data: Data;
  has_more: boolean;
};
//#endregion
//#region src/common/interfaces/patch-option.interface.d.ts
export interface PatchOptions extends RequestOptions {
  query?: {
    [key: string]: unknown;
  };
}
//#endregion
//#region src/common/interfaces/post-option.interface.d.ts
export interface PostOptions extends RequestOptions {
  query?: {
    [key: string]: unknown;
  };
}
//#endregion
//#region src/common/interfaces/put-option.interface.d.ts
export interface PutOptions extends RequestOptions {
  query?: {
    [key: string]: unknown;
  };
}
//#endregion
//#region src/common/interfaces/require-at-least-one.d.ts
export type RequireAtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>; }[keyof T];
//#endregion
//#region src/api-keys/interfaces/create-api-key-options.interface.d.ts
export interface CreateApiKeyOptions {
  name: string;
  permission?: 'full_access' | 'sending_access';
  domain_id?: string;
}
export interface CreateApiKeyRequestOptions extends PostOptions {}
export interface CreateApiKeyResponseSuccess {
  token: string;
  id: string;
}
export type CreateApiKeyResponse = Response<CreateApiKeyResponseSuccess>;
//#endregion
//#region src/api-keys/interfaces/list-api-keys.interface.d.ts
export type ListApiKeysOptions = PaginationOptions;
export type ListApiKeysResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: Pick<ApiKey, 'name' | 'id' | 'created_at' | 'last_used_at'>[];
};
export type ListApiKeysResponse = Response<ListApiKeysResponseSuccess>;
//#endregion
//#region src/api-keys/interfaces/remove-api-keys.interface.d.ts
export type RemoveApiKeyResponseSuccess = Pick<ApiKey, 'id'> & {
  object: 'api_key';
  deleted: boolean;
};
export type RemoveApiKeyResponse = Response<RemoveApiKeyResponseSuccess>;
//#endregion
//#region src/api-keys/interfaces/update-api-key-options.interface.d.ts
export interface UpdateApiKeyOptions {
  name: string;
}
export interface UpdateApiKeyResponseSuccess {
  object: 'api_key';
  id: string;
}
export type UpdateApiKeyResponse = Response<UpdateApiKeyResponseSuccess>;
//#endregion
//#region src/automations/interfaces/automation-step.interface.d.ts
export type ConditionRule = {
  type: 'rule';
  field: string;
  operator: 'eq' | 'neq';
  value: string | number | boolean | null;
} | {
  type: 'rule';
  field: string;
  operator: 'gt' | 'gte' | 'lt' | 'lte';
  value: number;
} | {
  type: 'rule';
  field: string;
  operator: 'contains' | 'starts_with' | 'ends_with';
  value: string;
} | {
  type: 'rule';
  field: string;
  operator: 'exists' | 'is_empty';
} | {
  type: 'and';
  rules: ConditionRule[];
} | {
  type: 'or';
  rules: ConditionRule[];
};
export type TemplateVariableValue = string | number | boolean | {
  var: string;
} | Record<string, string | number | boolean> | Array<string | number | boolean | Record<string, string | number | boolean>>;
export interface TriggerStepConfig {
  eventName: string;
}
export interface DelayStepConfig {
  duration: string;
}
export interface SendEmailStepConfig {
  template: {
    id: string;
    variables?: Record<string, TemplateVariableValue>;
  };
  subject?: string;
  from?: string;
  replyTo?: string;
}
export interface WaitForEventStepConfig {
  eventName: string;
  timeout?: string;
  filterRule?: ConditionRule;
}
export type ConditionStepConfig = ConditionRule;
export interface ContactUpdateStepConfig {
  firstName?: string | null | {
    var: string;
  };
  lastName?: string | null | {
    var: string;
  };
  unsubscribed?: boolean | {
    var: string;
  };
  properties?: Record<string, string | number | boolean | null | {
    var: string;
  }>;
}
export type ContactDeleteStepConfig = Record<string, never>;
export interface AddToSegmentStepConfig {
  segmentId: string;
}
export type AutomationStep = {
  key: string;
  type: 'trigger';
  config: TriggerStepConfig;
} | {
  key: string;
  type: 'delay';
  config: DelayStepConfig;
} | {
  key: string;
  type: 'send_email';
  config: SendEmailStepConfig;
} | {
  key: string;
  type: 'wait_for_event';
  config: WaitForEventStepConfig;
} | {
  key: string;
  type: 'condition';
  config: ConditionStepConfig;
} | {
  key: string;
  type: 'contact_update';
  config: ContactUpdateStepConfig;
} | {
  key: string;
  type: 'contact_delete';
  config: ContactDeleteStepConfig;
} | {
  key: string;
  type: 'add_to_segment';
  config: AddToSegmentStepConfig;
};
export type AutomationConnectionType = 'default' | 'condition_met' | 'condition_not_met' | 'timeout' | 'event_received';
export interface AutomationConnection {
  from: string;
  to: string;
  type?: AutomationConnectionType;
}
export type AutomationStepType = AutomationStep['type'];
export interface AutomationResponseStep {
  key: string;
  type: AutomationStepType;
  config: Record<string, unknown>;
}
export interface AutomationResponseConnection {
  from: string;
  to: string;
  type: AutomationConnectionType;
}
//#endregion
//#region src/automation-runs/interfaces/automation-run.d.ts
export type AutomationRunStatus = 'running' | 'completed' | 'failed' | 'cancelled';
export type AutomationRunStepStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped' | 'waiting';
export interface AutomationRunStep {
  key: string;
  type: AutomationStepType;
  status: AutomationRunStepStatus;
  output: Record<string, unknown> | null;
  error: Record<string, unknown> | null;
  started_at: string | null;
  completed_at: string | null;
  created_at: string;
}
export interface AutomationRun {
  object: 'automation_run';
  id: string;
  status: AutomationRunStatus;
  started_at: string | null;
  completed_at: string | null;
  created_at: string;
  steps: AutomationRunStep[];
}
export type AutomationRunItem = Pick<AutomationRun, 'id' | 'status' | 'started_at' | 'completed_at' | 'created_at'>;
//#endregion
//#region src/automation-runs/interfaces/get-automation-run.interface.d.ts
export interface GetAutomationRunOptions {
  automationId: string;
  runId: string;
}
export type GetAutomationRunResponseSuccess = AutomationRun;
export type GetAutomationRunResponse = Response<GetAutomationRunResponseSuccess>;
//#endregion
//#region src/automation-runs/interfaces/list-automation-runs.interface.d.ts
export type ListAutomationRunsOptions = PaginationOptions & {
  automationId: string;
  status?: AutomationRunStatus | AutomationRunStatus[];
};
export type ListAutomationRunsResponseSuccess = PaginatedData<AutomationRunItem[]>;
export type ListAutomationRunsResponse = Response<ListAutomationRunsResponseSuccess>;
//#endregion
//#region src/automations/interfaces/automation.d.ts
export interface Automation {
  id: string;
  name: string;
  status: 'enabled' | 'disabled';
  created_at: string;
  updated_at: string | null;
}
export type AutomationStatus = Automation['status'];
//#endregion
//#region src/automations/interfaces/create-automation-options.interface.d.ts
export interface CreateAutomationOptions {
  name: string;
  status?: AutomationStatus;
  steps: AutomationStep[];
  connections: AutomationConnection[];
}
export interface CreateAutomationResponseSuccess {
  object: 'automation';
  id: string;
}
export type CreateAutomationResponse = Response<CreateAutomationResponseSuccess>;
//#endregion
//#region src/automations/interfaces/duplicate-automation.interface.d.ts
export interface DuplicateAutomationResponseSuccess extends Pick<Automation, 'id'> {
  object: 'automation';
}
export type DuplicateAutomationResponse = Response<DuplicateAutomationResponseSuccess>;
//#endregion
//#region src/automations/interfaces/get-automation.interface.d.ts
export interface GetAutomationResponseSuccess extends Automation {
  object: 'automation';
  steps: AutomationResponseStep[];
  connections: AutomationResponseConnection[];
}
export type GetAutomationResponse = Response<GetAutomationResponseSuccess>;
//#endregion
//#region src/automations/interfaces/list-automation.interface.d.ts
export type ListAutomationsOptions = PaginationOptions & {
  status?: AutomationStatus;
};
export type ListAutomationsResponseSuccess = PaginatedData<Automation[]>;
export type ListAutomationsResponse = Response<ListAutomationsResponseSuccess>;
//#endregion
//#region src/automations/interfaces/remove-automation.interface.d.ts
export interface RemoveAutomationResponseSuccess extends Pick<Automation, 'id'> {
  object: 'automation';
  deleted: boolean;
}
export type RemoveAutomationResponse = Response<RemoveAutomationResponseSuccess>;
//#endregion
//#region src/automations/interfaces/stop-automation.interface.d.ts
export interface StopAutomationResponseSuccess {
  object: 'automation';
  id: string;
  status: 'disabled';
}
export type StopAutomationResponse = Response<StopAutomationResponseSuccess>;
//#endregion
//#region src/automations/interfaces/update-automation.interface.d.ts
export interface UpdateAutomationOptions {
  name?: string;
  status?: AutomationStatus;
  steps?: AutomationStep[];
  connections?: AutomationConnection[];
}
export interface UpdateAutomationResponseSuccess extends Pick<Automation, 'id'> {
  object: 'automation';
}
export type UpdateAutomationResponse = Response<UpdateAutomationResponseSuccess>;
//#endregion
//#region src/emails/interfaces/create-email-options.interface.d.ts
interface EmailRenderOptions$1 {
  /**
   * The React component used to write the message.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  react: React$1.ReactNode;
  /**
   * The HTML version of the message.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  html: string;
  /**
   * The plain text version of the message.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  text: string;
}
interface EmailTemplateOptions {
  template: {
    id: string;
    variables?: Record<string, string | number>;
  };
}
interface CreateEmailBaseOptionsWithTemplate extends Omit<CreateEmailBaseOptions, 'from' | 'subject'> {
  from?: string;
  subject?: string;
}
interface CreateEmailBaseOptions {
  /**
   * Filename and content of attachments (max 40mb per email)
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  attachments?: Attachment[];
  /**
   * Blind carbon copy recipient email address. For multiple addresses, send as an array of strings.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  bcc?: string | string[];
  /**
   * Carbon copy recipient email address. For multiple addresses, send as an array of strings.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  cc?: string | string[];
  /**
   * Sender email address. To include a friendly name, use the format `"Your Name <sender@domain.com>"`
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  from: string;
  /**
   * Custom headers to add to the email.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  headers?: Record<string, string>;
  /**
   * Reply-to email address. For multiple addresses, send as an array of strings.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  replyTo?: string | string[];
  /**
   * Email subject.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  subject: string;
  /**
   * Email tags
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  tags?: Tag[];
  /**
   * Recipient email address. For multiple addresses, send as an array of strings. Max 50.
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  to: string | string[];
  /**
   * The id of the topic you want to send to
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  topicId?: string | null;
  /**
   * Schedule email to be sent later.
   * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
   *
   * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
   */
  scheduledAt?: string;
}
export type CreateEmailOptions = ((RequireAtLeastOne<EmailRenderOptions$1> & CreateEmailBaseOptions) & {
  template?: never;
}) | ((EmailTemplateOptions & CreateEmailBaseOptionsWithTemplate) & {
  react?: never;
  html?: never;
  text?: never;
});
export interface CreateEmailRequestOptions extends PostOptions, IdempotentRequest {}
export interface CreateEmailResponseSuccess {
  /** The ID of the newly created email. */
  id: string;
}
export type CreateEmailResponse = Response<CreateEmailResponseSuccess>;
export interface Attachment {
  /** Content of an attached file. */
  content?: string | Buffer;
  /** Name of attached file. */
  filename?: string | false | undefined;
  /** Path where the attachment file is hosted */
  path?: string;
  /** Optional content type for the attachment, if not set will be derived from the filename property */
  contentType?: string;
  /**
   * Optional content ID for the attachment, to be used as a reference in the HTML content.
   * If set, this attachment will be sent as an inline attachment and you can reference it in the HTML content using the `cid:` prefix.
   */
  contentId?: string;
}
export type Tag = {
  /**
   * The name of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters.
   */
  name: string;
  /**
   * The value of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters.
   */
  value: string;
};
//#endregion
//#region src/batch/interfaces/create-batch-options.interface.d.ts
/**
 * Distributes over union members, unlike the built-in `Omit`, which would
 * collapse `CreateEmailOptions` into a single object type and lose the
 * mutual exclusivity between its `react`/`html`/`text` and `template` variants.
 */
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
/**
 * Email options for batch sending. Same as CreateEmailOptions but without attachments,
 * as these are not supported in the batch API.
 *
 * @link https://resend.com/docs/dashboard/emails/batch-sending#limitations
 */
export type CreateBatchEmailOptions = DistributiveOmit<CreateEmailOptions, 'attachments'>;
export type CreateBatchOptions = CreateBatchEmailOptions[];
export interface CreateBatchRequestOptions extends PostOptions, IdempotentRequest {
  /**
   * @default 'strict'
   */
  batchValidation?: 'strict' | 'permissive';
}
export type CreateBatchSuccessResponse<Options extends CreateBatchRequestOptions = CreateBatchRequestOptions> = {
  data: {
    /** The ID of the newly created email. */
    id: string;
  }[];
} & (Options['batchValidation'] extends 'permissive' ? {
  /**
   * Only present when `batchValidation` is set to 'permissive'.
   */
  errors: {
    /**
     * The index of the failed email in the batch
     */
    index: number;
    /**
     * The error message for the failed email
     */
    message: string;
  }[];
} : Record<string, never>);
export type CreateBatchResponse<Options extends CreateBatchRequestOptions> = Response<CreateBatchSuccessResponse<Options>>;
//#endregion
//#region src/broadcasts/interfaces/broadcast.d.ts
export interface Broadcast {
  id: string;
  name: string;
  segment_id: string | null;
  audience_id: string | null;
  from: string | null;
  subject: string | null;
  reply_to: string[] | null;
  preview_text: string | null;
  status: 'draft' | 'sent' | 'queued';
  created_at: string;
  scheduled_at: string | null;
  sent_at: string | null;
  topic_id?: string | null;
  html: string | null;
  text: string | null;
}
//#endregion
//#region src/broadcasts/interfaces/cancel-broadcast.interface.d.ts
export interface CancelBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
  object: 'broadcast';
}
export type CancelBroadcastResponse = Response<CancelBroadcastResponseSuccess>;
//#endregion
//#region src/broadcasts/interfaces/create-broadcast-options.interface.d.ts
interface EmailRenderOptions {
  /**
   * The React component used to write the message.
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  react: React$1.ReactNode;
  /**
   * The HTML version of the message.
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  html: string;
  /**
   * The plain text version of the message.
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  text: string;
}
interface SegmentOptions {
  /**
   * The id of the segment you want to send to
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  segmentId: string;
  /**
   * @deprecated Use segmentId instead
   */
  audienceId: string;
}
type SendBroadcastOnCreationOptions = {
  /**
   * Whether to send the broadcast immediately or keep it as a draft.
   * If not provided or set to false, the broadcast will be created as a draft.
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  send: true;
  /**
   * Schedule time to send the broadcast. Can only be used if `send` is true.
   * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z)
   * or relative time (eg: in 2 days).
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  scheduledAt?: string;
} | {
  /**
   * Whether to send the broadcast immediately or keep it as a draft.
   * If not provided or set to false, the broadcast will be created as a draft.
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  send?: false;
  /**
   * Schedule time to send the broadcast. Can only be used if `send` is true.
   * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z)
   * or relative time (eg: in 2 days).
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  scheduledAt?: never;
};
interface CreateBroadcastBaseOptions {
  /**
   * The name of the broadcast
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  name?: string;
  /**
   * A short snippet of text displayed as a preview in recipients' inboxes, often shown below or beside the subject line.
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  previewText?: string;
  /**
   * Sender email address. To include a friendly name, use the format `"Your Name <sender@domain.com>"`
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  from: string;
  /**
   * Reply-to email address. For multiple addresses, send as an array of strings.
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  replyTo?: string | string[];
  /**
   * Email subject.
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  subject: string;
  /**
   * The id of the topic you want to send to
   *
   * @link https://resend.com/docs/api-reference/broadcasts/create-broadcast#body-parameters
   */
  topicId?: string | null;
}
export type CreateBroadcastOptions = RequireAtLeastOne<EmailRenderOptions> & RequireAtLeastOne<SegmentOptions> & CreateBroadcastBaseOptions & SendBroadcastOnCreationOptions;
export interface CreateBroadcastRequestOptions extends PostOptions {}
export interface CreateBroadcastResponseSuccess {
  /** The ID of the newly sent broadcasts. */
  id: string;
}
export type CreateBroadcastResponse = Response<CreateBroadcastResponseSuccess>;
//#endregion
//#region src/broadcasts/interfaces/duplicate-broadcast.interface.d.ts
export interface DuplicateBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
  object: 'broadcast';
}
export type DuplicateBroadcastResponse = Response<DuplicateBroadcastResponseSuccess>;
//#endregion
//#region src/broadcasts/interfaces/get-broadcast.interface.d.ts
export interface GetBroadcastResponseSuccess extends Broadcast {
  object: 'broadcast';
}
export type GetBroadcastResponse = Response<GetBroadcastResponseSuccess>;
//#endregion
//#region src/broadcasts/interfaces/list-broadcast-clicked-links.interface.d.ts
export type ListBroadcastClickedLinksOptions = PaginationOptions;
export type BroadcastClickedLink = {
  /**
   * `id` is an opaque cursor for this row, used only for pagination.
   * It does not identify any entity in Resend.
   */
  id: string;
  url: string;
  clicks: number;
  unique_clicks: number;
};
export type ListBroadcastClickedLinksResponseSuccess = PaginatedData<BroadcastClickedLink[]>;
export type ListBroadcastClickedLinksResponse = Response<ListBroadcastClickedLinksResponseSuccess>;
//#endregion
//#region src/broadcasts/interfaces/list-broadcast-recipients.interface.d.ts
export type BroadcastRecipientEventType = 'sent' | 'delivered' | 'opened' | 'clicked' | 'bounced' | 'complained' | 'unsubscribed' | 'suppressed';
export type BroadcastRecipientBounceType = 'permanent' | 'transient' | 'undetermined';
export type ListBroadcastRecipientsOptions<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = PaginationOptions & {
  type: T;
  email?: string;
  bounceType?: T extends 'bounced' ? BroadcastRecipientBounceType : never;
};
export interface BroadcastRecipientClickedLink {
  url: string;
  clicks: number;
}
type BroadcastRecipientBase = {
  id: string;
  contact_id: string | null;
  email: string;
};
type BroadcastRecipientLoose = BroadcastRecipientBase & {
  count?: number;
  clicked_links?: BroadcastRecipientClickedLink[];
  bounce_type?: BroadcastRecipientBounceType;
};
type IsUnion<T, B = T> = T extends B ? ([B] extends [T] ? false : true) : never;
type BroadcastRecipientFieldsByType = {
  sent: unknown;
  delivered: unknown;
  opened: {
    count: number;
  };
  clicked: {
    count: number;
    clicked_links: BroadcastRecipientClickedLink[];
  };
  bounced: {
    bounce_type: BroadcastRecipientBounceType;
  };
  complained: unknown;
  unsubscribed: unknown;
  suppressed: unknown;
};
export type BroadcastRecipient<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = IsUnion<T> extends true ? BroadcastRecipientLoose : BroadcastRecipientBase & BroadcastRecipientFieldsByType[T];
export type ListBroadcastRecipientsResponseSuccess<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = PaginatedData<BroadcastRecipient<T>[]>;
export type ListBroadcastRecipientsResponse<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = Response<ListBroadcastRecipientsResponseSuccess<T>>;
//#endregion
//#region src/broadcasts/interfaces/list-broadcasts.interface.d.ts
export type ListBroadcastsOptions = PaginationOptions;
export type ListBroadcastsResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: Pick<Broadcast, 'id' | 'name' | 'audience_id' | 'segment_id' | 'status' | 'created_at' | 'scheduled_at' | 'sent_at'>[];
};
export type ListBroadcastsResponse = Response<ListBroadcastsResponseSuccess>;
//#endregion
//#region src/broadcasts/interfaces/remove-broadcast.interface.d.ts
export interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
  object: 'broadcast';
  deleted: boolean;
}
export type RemoveBroadcastResponse = Response<RemoveBroadcastResponseSuccess>;
//#endregion
//#region src/broadcasts/interfaces/send-broadcast-options.interface.d.ts
interface SendBroadcastBaseOptions {
  /**
   * Schedule email to be sent later.
   * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z)
   * or relative time (eg: in 2 days).
   *
   * @link https://resend.com/docs/api-reference/broadcasts/send-broadcast#body-parameters
   */
  scheduledAt?: string;
}
export type SendBroadcastOptions = SendBroadcastBaseOptions;
export interface SendBroadcastRequestOptions extends PostOptions {}
export interface SendBroadcastResponseSuccess {
  /** The ID of the sent broadcast. */
  id: string;
}
export type SendBroadcastResponse = Response<SendBroadcastResponseSuccess>;
//#endregion
//#region src/broadcasts/interfaces/update-broadcast.interface.d.ts
export interface UpdateBroadcastResponseSuccess {
  id: string;
}
export type UpdateBroadcastOptions = {
  name?: string;
  segmentId?: string;
  /**
   * @deprecated Use segmentId instead
   */
  audienceId?: string;
  from?: string;
  html?: string;
  react?: React.ReactNode;
  text?: string;
  subject?: string;
  replyTo?: string[];
  previewText?: string;
  topicId?: string | null;
};
export type UpdateBroadcastResponse = Response<UpdateBroadcastResponseSuccess>;
//#endregion
//#region src/contact-properties/interfaces/contact-property.d.ts
type StringBaseApiContactProperty = {
  type: 'string';
  fallback_value: string | null;
};
type NumberBaseApiContactProperty = {
  type: 'number';
  fallback_value: number | null;
};
export type ApiContactProperty = {
  id: string;
  created_at: string;
  key: string;
} & (StringBaseApiContactProperty | NumberBaseApiContactProperty);
type StringBaseContactProperty = {
  type: 'string';
  fallbackValue: string | null;
};
type NumberBaseContactProperty = {
  type: 'number';
  fallbackValue: number | null;
};
export type ContactProperty = {
  id: string;
  createdAt: string;
  key: string;
} & (StringBaseContactProperty | NumberBaseContactProperty);
//#endregion
//#region src/contact-properties/interfaces/create-contact-property-options.interface.d.ts
type StringBaseContactPropertyOptions = {
  type: 'string';
  fallbackValue?: string | null;
};
type NumberBaseContactPropertyOptions = {
  type: 'number';
  fallbackValue?: number | null;
};
export type CreateContactPropertyOptions = {
  key: string;
} & (StringBaseContactPropertyOptions | NumberBaseContactPropertyOptions);
export interface CreateContactPropertyApiOptions {
  key: string;
  type: 'string' | 'number';
  fallback_value?: string | number | null;
}
export type CreateContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
  object: 'contact_property';
};
export type CreateContactPropertyResponse = Response<CreateContactPropertyResponseSuccess>;
//#endregion
//#region src/contact-properties/interfaces/delete-contact-property-options.interface.d.ts
export type RemoveContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
  object: 'contact_property';
  deleted: boolean;
};
export type RemoveContactPropertyResponse = Response<RemoveContactPropertyResponseSuccess>;
//#endregion
//#region src/contact-properties/interfaces/get-contact-property.interface.d.ts
export type GetContactPropertyResponseSuccess = ApiContactProperty & {
  object: 'contact_property';
};
export type GetContactPropertyResponse = Response<ContactProperty & {
  object: 'contact_property';
}>;
//#endregion
//#region src/contact-properties/interfaces/list-contact-properties-options.interface.d.ts
export type ListContactPropertiesOptions = PaginationOptions;
export type ListContactPropertiesResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: ApiContactProperty[];
};
export type ListContactPropertiesResponse = Response<{
  object: 'list';
  has_more: boolean;
  data: ContactProperty[];
}>;
//#endregion
//#region src/contact-properties/interfaces/update-contact-property-options.interface.d.ts
export type UpdateContactPropertyOptions = {
  id: string;
  fallbackValue?: string | number | null;
};
export interface UpdateContactPropertyApiOptions {
  fallback_value?: string | number | null;
}
export type UpdateContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
  object: 'contact_property';
};
export type UpdateContactPropertyResponse = Response<UpdateContactPropertyResponseSuccess>;
//#endregion
//#region src/contacts/imports/interfaces/contact-import.interface.d.ts
export type ContactImportStatus = 'queued' | 'in_progress' | 'completed' | 'failed';
export interface ContactImportCounts {
  total: number;
  created: number;
  updated: number;
  skipped: number;
  failed: number;
}
export interface ContactImport {
  object: 'contact_import';
  id: string;
  status: ContactImportStatus;
  created_at: string;
  completed_at: string | null;
  counts: ContactImportCounts;
}
//#endregion
//#region src/contacts/imports/interfaces/create-contact-import.interface.d.ts
export type ContactImportOnConflict = 'upsert' | 'skip';
export type ContactImportPropertyType = 'string' | 'number' | 'boolean';
export interface ContactImportPropertyMapping {
  column: string;
  type?: ContactImportPropertyType;
}
export interface ContactImportColumnMap {
  email?: string;
  firstName?: string;
  lastName?: string;
  unsubscribed?: string;
  properties?: Record<string, ContactImportPropertyMapping>;
}
export interface ContactImportSegment {
  id: string;
}
export interface ContactImportTopic {
  id: string;
  subscription: 'opt_in' | 'opt_out';
}
export interface CreateContactImportOptions {
  file: Blob;
  columnMap?: ContactImportColumnMap;
  onConflict?: ContactImportOnConflict;
  segments?: ContactImportSegment[];
  topics?: ContactImportTopic[];
}
export interface CreateContactImportRequestOptions extends PostOptions {}
export interface CreateContactImportResponseSuccess {
  object: 'contact_import';
  id: string;
}
export type CreateContactImportResponse = Response<CreateContactImportResponseSuccess>;
//#endregion
//#region src/contacts/imports/interfaces/get-contact-import.interface.d.ts
export type GetContactImportResponseSuccess = ContactImport;
export type GetContactImportResponse = Response<GetContactImportResponseSuccess>;
//#endregion
//#region src/contacts/imports/interfaces/list-contact-imports.interface.d.ts
export type ListContactImportsOptions = PaginationOptions & {
  status?: ContactImportStatus;
};
export type ListContactImportsResponseSuccess = PaginatedData<ContactImport[]>;
export type ListContactImportsResponse = Response<ListContactImportsResponseSuccess>;
//#endregion
//#region src/contacts/interfaces/contact.d.ts
export interface Contact {
  created_at: string;
  id: string;
  email: string;
  first_name: string | null;
  last_name: string | null;
  unsubscribed: boolean;
}
export type SelectingField = {
  /**
   * The contact id.
   *
   * @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
   */
  id: string;
  /**
   * The contact email.
   *
   * @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
   */
  email?: undefined | null;
} | {
  /**
   * The contact id.
   *
   * @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
   */
  id?: undefined | null;
  /**
   * The contact email.
   *
   * @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
   */
  email: string;
};
//#endregion
//#region src/contacts/interfaces/create-contact-options.interface.d.ts
interface CreateContactPropertiesOptions {
  [key: string]: string | number | null;
}
export interface LegacyCreateContactOptions {
  /**
   * @deprecated Use `segments` instead to add one or more segments to the new contact
   *
   * @see https://resend.com/docs/dashboard/segments/migrating-from-audiences-to-segments
   */
  audienceId: string;
  email: string;
  unsubscribed?: boolean;
  firstName?: string;
  lastName?: string;
  properties?: CreateContactPropertiesOptions;
}
export interface CreateContactOptions {
  email: string;
  unsubscribed?: boolean;
  firstName?: string;
  lastName?: string;
  properties?: CreateContactPropertiesOptions;
  segments?: {
    id: string;
  }[];
  topics?: {
    id: string;
    subscription: 'opt_in' | 'opt_out';
  }[];
}
export interface CreateContactRequestOptions extends PostOptions {}
export interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
  object: 'contact';
}
export type CreateContactResponse = Response<CreateContactResponseSuccess>;
//#endregion
//#region src/contacts/interfaces/get-contact.interface.d.ts
export type GetContactOptions = string | ({
  audienceId?: string;
} & SelectingField);
type ContactPropertyValue = {
  type: 'string';
  value: string;
} | {
  type: 'number';
  value: number;
};
interface ContactProperties$1 {
  [key: string]: ContactPropertyValue;
}
export interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'email' | 'created_at' | 'first_name' | 'last_name' | 'unsubscribed'> {
  object: 'contact';
  properties: ContactProperties$1;
}
export type GetContactResponse = Response<GetContactResponseSuccess>;
//#endregion
//#region src/contacts/interfaces/list-contacts.interface.d.ts
export type ListContactsOptions = PaginationOptions & {
  segmentId?: string;
  /**
   * @deprecated Use segmentId instead to filter by segment
   */
  audienceId?: string;
};
export interface ListContactsResponseSuccess {
  object: 'list';
  data: Contact[];
  has_more: boolean;
}
export type ListContactsResponse = Response<ListContactsResponseSuccess>;
//#endregion
//#region src/contacts/interfaces/remove-contact.interface.d.ts
export type RemoveContactsResponseSuccess = {
  object: 'contact';
  deleted: boolean;
  contact: string;
};
export type RemoveContactOptions = string | (SelectingField & {
  audienceId?: string;
});
export type RemoveContactsResponse = Response<RemoveContactsResponseSuccess>;
//#endregion
//#region src/contacts/interfaces/update-contact.interface.d.ts
interface UpdateContactPropertiesOptions {
  [key: string]: string | number | boolean | null;
}
export type UpdateContactOptions = {
  audienceId?: string;
  unsubscribed?: boolean;
  /**
   * Use `null` to clear the `firstName`
   */
  firstName?: string | null;
  /**
   * Use `null` to clear the `lastName`
   */
  lastName?: string | null;
  properties?: UpdateContactPropertiesOptions;
} & SelectingField;
export type UpdateContactResponseSuccess = Pick<Contact, 'id'> & {
  object: 'contact';
};
export type UpdateContactResponse = Response<UpdateContactResponseSuccess>;
//#endregion
//#region src/contacts/segments/interfaces/contact-segments.interface.d.ts
export type ContactSegmentsBaseOptions = {
  contactId: string;
  email?: never;
} | {
  contactId?: never;
  email: string;
};
//#endregion
//#region src/contacts/segments/interfaces/add-contact-segment.interface.d.ts
export type AddContactSegmentOptions = ContactSegmentsBaseOptions & {
  segmentId: string;
};
export interface AddContactSegmentResponseSuccess {
  id: string;
}
export type AddContactSegmentResponse = Response<AddContactSegmentResponseSuccess>;
//#endregion
//#region src/segments/interfaces/segment.d.ts
export interface Segment {
  created_at: string;
  id: string;
  name: string;
}
//#endregion
//#region src/contacts/segments/interfaces/list-contact-segments.interface.d.ts
export type ListContactSegmentsOptions = PaginationOptions & ContactSegmentsBaseOptions;
export type ListContactSegmentsResponseSuccess = PaginatedData<Segment[]>;
export type ListContactSegmentsResponse = Response<ListContactSegmentsResponseSuccess>;
//#endregion
//#region src/contacts/segments/interfaces/remove-contact-segment.interface.d.ts
export type RemoveContactSegmentOptions = ContactSegmentsBaseOptions & {
  segmentId: string;
};
export interface RemoveContactSegmentResponseSuccess {
  id: string;
  audienceId: string;
  deleted: boolean;
}
export type RemoveContactSegmentResponse = Response<RemoveContactSegmentResponseSuccess>;
//#endregion
//#region src/contacts/topics/interfaces/list-contact-topics.interface.d.ts
interface ListContactTopicsBaseOptions {
  id?: string;
  email?: string;
}
export type ListContactTopicsOptions = ListContactTopicsBaseOptions & PaginationOptions;
export interface ListContactTopicsRequestOptions extends GetOptions {}
export interface ContactTopic {
  id: string;
  name: string;
  description: string | null;
  subscription: 'opt_in' | 'opt_out';
}
export type ListContactTopicsResponseSuccess = PaginatedData<ContactTopic[]>;
export type ListContactTopicsResponse = Response<ListContactTopicsResponseSuccess>;
//#endregion
//#region src/contacts/topics/interfaces/update-contact-topics.interface.d.ts
interface UpdateContactTopicsBaseOptions {
  id?: string;
  email?: string;
}
export interface UpdateContactTopicsOptions extends UpdateContactTopicsBaseOptions {
  topics: {
    id: string;
    subscription: 'opt_in' | 'opt_out';
  }[];
}
export interface UpdateContactTopicsRequestOptions extends PatchOptions {}
export interface UpdateContactTopicsResponseSuccess {
  id: string;
}
export type UpdateContactTopicsResponse = Response<UpdateContactTopicsResponseSuccess>;
//#endregion
//#region src/domains/claims/interfaces/domain-claim.d.ts
export type DomainClaimStatus = 'pending' | 'verified' | 'completed' | 'blocked' | 'expired' | 'superseded' | 'canceled' | 'failed';
export type DomainClaimBlockedReason = 'grace_period' | 'recent_owner_activity' | 'pending_scheduled_emails';
export interface DomainClaimRecord {
  type: 'TXT';
  name: string;
  value: string;
  ttl: 'Auto';
}
export interface DomainClaim {
  id: string;
  name: string;
  status: DomainClaimStatus;
  domain_id: string | null;
  region: DomainRegion | null;
  record: DomainClaimRecord;
  blocked_reason: DomainClaimBlockedReason | null;
  failure_reason: string | null;
  created_at: string;
  expires_at: string;
}
//#endregion
//#region src/domains/claims/interfaces/claim-domain-options.interface.d.ts
export interface ClaimDomainOptions {
  name: string;
  region?: DomainRegion;
  customReturnPath?: string;
  openTracking?: boolean;
  clickTracking?: boolean;
  trackingSubdomain?: string;
}
export interface ClaimDomainRequestOptions extends PostOptions {}
export interface ClaimDomainResponseSuccess extends DomainClaim {
  object: 'domain_claim';
}
export type ClaimDomainResponse = Response<ClaimDomainResponseSuccess>;
//#endregion
//#region src/domains/claims/interfaces/get-domain-claim.interface.d.ts
export interface GetDomainClaimResponseSuccess extends DomainClaim {
  object: 'domain_claim';
}
export type GetDomainClaimResponse = Response<GetDomainClaimResponseSuccess>;
//#endregion
//#region src/domains/claims/interfaces/verify-domain-claim.interface.d.ts
export interface VerifyDomainClaimResponseSuccess extends DomainClaim {
  object: 'domain_claim';
}
export type VerifyDomainClaimResponse = Response<VerifyDomainClaimResponseSuccess>;
//#endregion
//#region src/domains/interfaces/create-domain-options.interface.d.ts
export interface CreateDomainOptions {
  name: string;
  region?: DomainRegion;
  customReturnPath?: string;
  capabilities?: Partial<DomainCapabilities>;
  openTracking?: boolean;
  clickTracking?: boolean;
  tls?: 'enforced' | 'opportunistic';
  trackingSubdomain?: string;
}
export interface CreateDomainRequestOptions extends PostOptions {}
export interface CreateDomainResponseSuccess extends Pick<Domain, 'name' | 'id' | 'status' | 'created_at' | 'region' | 'open_tracking' | 'click_tracking' | 'tracking_subdomain'> {
  records: DomainRecords[];
  capabilities: DomainCapabilities;
}
export type CreateDomainResponse = Response<CreateDomainResponseSuccess>;
//#endregion
//#region src/domains/interfaces/get-domain.interface.d.ts
export interface GetDomainResponseSuccess extends Pick<Domain, 'id' | 'name' | 'created_at' | 'region' | 'status' | 'capabilities' | 'open_tracking' | 'click_tracking' | 'tracking_subdomain'> {
  object: 'domain';
  records: DomainRecords[];
}
export type GetDomainResponse = Response<GetDomainResponseSuccess>;
//#endregion
//#region src/domains/interfaces/list-domains.interface.d.ts
export type ListDomainsOptions = PaginationOptions;
export type ListDomainsResponseSuccess = {
  data: Domain[];
  object: 'list';
  has_more: boolean;
};
export type ListDomainsResponse = Response<ListDomainsResponseSuccess>;
//#endregion
//#region src/domains/interfaces/remove-domain.interface.d.ts
export type RemoveDomainsResponseSuccess = Pick<Domain, 'id'> & {
  object: 'domain';
  deleted: boolean;
};
export type RemoveDomainsResponse = Response<RemoveDomainsResponseSuccess>;
//#endregion
//#region src/domains/interfaces/update-domain.interface.d.ts
export interface UpdateDomainsOptions {
  id: string;
  clickTracking?: boolean;
  openTracking?: boolean;
  tls?: 'enforced' | 'opportunistic';
  capabilities?: Partial<DomainCapabilities>;
  trackingSubdomain?: string;
}
export type UpdateDomainsResponseSuccess = Pick<Domain, 'id'> & {
  object: 'domain';
};
export type UpdateDomainsResponse = Response<UpdateDomainsResponseSuccess>;
//#endregion
//#region src/domains/interfaces/verify-domain.interface.d.ts
export type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
  object: 'domain';
};
export type VerifyDomainsResponse = Response<VerifyDomainsResponseSuccess>;
//#endregion
//#region src/emails/attachments/interfaces/get-attachment.interface.d.ts
interface GetAttachmentOptions {
  emailId: string;
  id: string;
}
type GetAttachmentResponseSuccess = {
  object: 'attachment';
} & AttachmentData;
type GetAttachmentResponse = Response<GetAttachmentResponseSuccess>;
//#endregion
//#region src/emails/attachments/interfaces/list-attachments.interface.d.ts
type ListAttachmentsOptions = PaginationOptions & {
  emailId: string;
};
interface ListAttachmentsResponseSuccess {
  object: 'list';
  has_more: boolean;
  data: AttachmentData[];
}
type ListAttachmentsResponse = Response<ListAttachmentsResponseSuccess>;
//#endregion
//#region src/emails/interfaces/cancel-email-options.interface.d.ts
export interface CancelEmailResponseSuccess {
  object: 'email';
  id: string;
}
export type CancelEmailResponse = Response<CancelEmailResponseSuccess>;
//#endregion
//#region src/emails/interfaces/get-email-options.interface.d.ts
export interface GetEmailResponseSuccess {
  bcc: string[] | null;
  cc: string[] | null;
  created_at: string;
  from: string;
  html: string | null;
  id: string;
  message_id: string;
  last_event: 'bounced' | 'canceled' | 'clicked' | 'complained' | 'delivered' | 'delivery_delayed' | 'failed' | 'opened' | 'queued' | 'scheduled' | 'sent' | 'suppressed';
  reply_to: string[] | null;
  subject: string;
  text: string | null;
  tags?: {
    name: string;
    value: string;
  }[];
  to: string[];
  topic_id?: string | null;
  scheduled_at: string | null;
  object: 'email';
}
export type GetEmailResponse = Response<GetEmailResponseSuccess>;
//#endregion
//#region src/emails/interfaces/get-metrics.interface.d.ts
export type EmailMetric = 'received' | 'delivered' | 'complained' | 'suppressed' | 'bounced' | 'bounced_transient' | 'bounced_permanent' | 'bounced_undetermined' | 'opened' | 'clicked' | 'unsubscribed' | 'delivery_delayed' | 'failed' | 'sent' | 'unique_opened' | 'unique_clicked' | 'delivery_rate' | 'open_rate' | 'click_rate' | 'bounce_rate' | 'complaint_rate' | 'unsubscribe_rate';
export type EmailMetricsDimension = 'period' | 'domain' | 'email' | 'broadcast';
export type EmailMetricsGranularity = 'hourly' | 'daily' | 'weekly' | 'monthly';
type EmailMetricsCommonOptions = {
  /**
   * The start of the date range, as an ISO 8601 date or datetime.
   * Defaults to 6 days before `endDate`.
   *
   * @link https://resend.com/docs/api-reference/emails/get-metrics#query-parameters
   */
  startDate?: string;
  /**
   * The end of the date range, as an ISO 8601 date or datetime.
   * Defaults to now.
   *
   * @link https://resend.com/docs/api-reference/emails/get-metrics#query-parameters
   */
  endDate?: string;
  /**
   * The IANA timezone used to bucket periods when `period` is in `dimensions`.
   * Defaults to `UTC`.
   */
  timezone?: string;
  /**
   * The bucket size used when `period` is in `dimensions`.
   * Defaults to `daily`.
   */
  granularity?: EmailMetricsGranularity;
  /**
   * The metrics to include in the response. Defaults to all metrics.
   */
  metrics?: EmailMetric[];
  /**
   * Restrict the response to these sending domain IDs.
   */
  domainId?: string[];
};
export type GetEmailsMetricsOptions = EmailMetricsCommonOptions & ({
  /**
   * The dimensions to break the response down by. Defaults to `[]`,
   * which returns a single `totals` row for the whole range, with no
   * `data`. Cannot combine `broadcast` with `email`/`emailId`.
   */
  dimensions?: Exclude<EmailMetricsDimension, 'broadcast'>[];
  /**
   * Restrict the response to these email IDs. Cannot be combined with
   * the `broadcast` dimension or `broadcastId`.
   */
  emailId?: string[];
  broadcastId?: never;
} | {
  /**
   * The dimensions to break the response down by. Defaults to `[]`,
   * which returns a single `totals` row for the whole range, with no
   * `data`. Cannot combine `email` with `broadcast`/`broadcastId`.
   */
  dimensions?: Exclude<EmailMetricsDimension, 'email'>[];
  emailId?: never;
  /**
   * Restrict the response to these broadcast IDs. Cannot be combined
   * with the `email` dimension or `emailId`.
   */
  broadcastId?: string[];
});
export type EmailMetricsTotals = Partial<Record<EmailMetric, number>>;
export type EmailMetricsDataRow = EmailMetricsTotals & {
  period?: string;
  domain_id?: string;
  domain_name?: string;
  email_id?: string;
  broadcast_id?: string;
  broadcast_name?: string;
};
export interface GetEmailsMetricsResponseSuccess {
  object: 'metrics';
  start_date: string;
  end_date: string;
  metrics: EmailMetric[];
  dimensions: EmailMetricsDimension[];
  granularity: EmailMetricsGranularity;
  totals: EmailMetricsTotals;
  data?: EmailMetricsDataRow[];
}
export type GetEmailsMetricsResponse = Response<GetEmailsMetricsResponseSuccess>;
//#endregion
//#region src/emails/interfaces/list-emails-options.interface.d.ts
export type ListEmailsOptions = PaginationOptions;
export type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
export type ListEmailsResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: ListEmail[];
};
export type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
//#endregion
//#region src/emails/interfaces/share-email-options.interface.d.ts
export interface ShareEmailOptions {
  expiresIn?: string;
}
export interface ShareEmailResponseSuccess {
  object: 'email';
  id: string;
  url: string;
}
export type ShareEmailResponse = Response<ShareEmailResponseSuccess>;
//#endregion
//#region src/emails/interfaces/update-email-options.interface.d.ts
export interface UpdateEmailOptions {
  id: string;
  scheduledAt: string;
}
export interface UpdateEmailResponseSuccess {
  id: string;
  object: 'email';
}
export type UpdateEmailResponse = Response<UpdateEmailResponseSuccess>;
//#endregion
//#region src/emails/receiving/interfaces/forward-receiving-email.interface.d.ts
interface ForwardReceivingEmailBodyOptions {
  text: string;
  html: string;
}
interface ForwardReceivingEmailBaseOptions {
  emailId: string;
  to: string | string[];
  from: string;
}
export type ForwardReceivingEmailOptions = (ForwardReceivingEmailBaseOptions & {
  passthrough?: true;
}) | (ForwardReceivingEmailBaseOptions & {
  passthrough: false;
} & RequireAtLeastOne<ForwardReceivingEmailBodyOptions>);
export interface ForwardReceivingEmailRequestOptions extends PostOptions, IdempotentRequest {}
export interface ForwardReceivingEmailResponseSuccess {
  id: string;
}
export type ForwardReceivingEmailResponse = Response<ForwardReceivingEmailResponseSuccess>;
//#endregion
//#region src/emails/receiving/interfaces/get-receiving-email.interface.d.ts
/**
 * Attachment metadata embedded in the GET /inbounds/{id} response.
 * These are raw DB values — fields are nullable and content_disposition is
 * not normalized to a literal union.
 *
 * Not to be confused with AttachmentData, which is the shape returned by the
 * dedicated attachment endpoints (includes download_url and expires_at).
 */
export interface InboundAttachment {
  id: string;
  filename: string | null;
  size: number;
  content_type: string;
  content_id: string | null;
  content_disposition: string | null;
}
export interface GetReceivingEmailResponseSuccess {
  object: 'email';
  id: string;
  to: string[];
  from: string;
  created_at: string;
  subject: string;
  bcc: string[] | null;
  cc: string[] | null;
  reply_to: string[] | null;
  received_for: string[];
  html: string | null;
  text: string | null;
  headers: Record<string, string> | null;
  message_id: string;
  raw?: {
    download_url: string;
    expires_at: string;
  } | null;
  attachments: InboundAttachment[];
}
export type GetReceivingEmailResponse = Response<GetReceivingEmailResponseSuccess>;
export interface GetReceivingEmailOptions {
  /**
   * Controls how inline images are returned inside `html`. By default (or when
   * set to `'data_uri'`), inline images appear in `html` as base64 `data:` URIs.
   * Set to `'cid'` to keep the original `<img src="cid:..." />` references
   * instead, each of which matches the `content_id` of an attachment.
   */
  html_format?: 'data_uri' | 'cid';
}
//#endregion
//#region src/emails/receiving/interfaces/list-receiving-emails.interface.d.ts
export type ListReceivingEmailsOptions = PaginationOptions;
export type ListReceivingEmail = Omit<GetReceivingEmailResponseSuccess, 'html' | 'text' | 'headers' | 'raw' | 'object'>;
export interface ListReceivingEmailsResponseSuccess {
  object: 'list';
  has_more: boolean;
  data: ListReceivingEmail[];
}
export type ListReceivingEmailsResponse = {
  data: ListReceivingEmailsResponseSuccess;
  error: null;
} | {
  data: null;
  error: ErrorResponse;
};
//#endregion
//#region src/events/interfaces/event.d.ts
export type EventSchemaType = 'string' | 'number' | 'boolean' | 'date';
export type EventSchemaMap = Record<string, EventSchemaType>;
export interface Event {
  id: string;
  name: string;
  schema: EventSchemaMap | null;
  created_at: string;
  updated_at: string | null;
}
//#endregion
//#region src/events/interfaces/create-event.interface.d.ts
export interface CreateEventOptions {
  name: string;
  schema?: EventSchemaMap | null;
}
export interface CreateEventResponseSuccess {
  object: 'event';
  id: string;
}
export type CreateEventResponse = Response<CreateEventResponseSuccess>;
//#endregion
//#region src/events/interfaces/get-event.interface.d.ts
export interface GetEventResponseSuccess extends Event {
  object: 'event';
}
export type GetEventResponse = Response<GetEventResponseSuccess>;
//#endregion
//#region src/events/interfaces/list-events.interface.d.ts
export type ListEventsOptions = PaginationOptions;
export interface ListEventsResponseSuccess {
  object: 'list';
  has_more: boolean;
  data: Event[];
}
export type ListEventsResponse = Response<ListEventsResponseSuccess>;
//#endregion
//#region src/events/interfaces/remove-event.interface.d.ts
export interface RemoveEventResponseSuccess extends Pick<Event, 'id'> {
  object: 'event';
  deleted: boolean;
}
export type RemoveEventResponse = Response<RemoveEventResponseSuccess>;
//#endregion
//#region src/events/interfaces/send-event.interface.d.ts
export type SendEventOptions = {
  event: string;
  contactId: string;
  email?: never;
  payload?: Record<string, unknown>;
} | {
  event: string;
  email: string;
  contactId?: never;
  payload?: Record<string, unknown>;
};
export interface SendEventResponseSuccess {
  object: 'event';
  event: string;
}
export type SendEventResponse = Response<SendEventResponseSuccess>;
//#endregion
//#region src/events/interfaces/update-event.interface.d.ts
export interface UpdateEventOptions {
  schema: EventSchemaMap | null;
}
export interface UpdateEventResponseSuccess {
  object: 'event';
  id: string;
}
export type UpdateEventResponse = Response<UpdateEventResponseSuccess>;
//#endregion
//#region src/inboxes/agent/interfaces/agent.d.ts
export declare const INBOX_AGENT_ACTIONS: readonly ["draft_reply", "forward_thread", "add_labels", "assign_thread", "mark_as_spam", "archive", "move_to_trash"];
type InboxAgentAction = (typeof INBOX_AGENT_ACTIONS)[number];
export declare const INBOX_AGENT_TONES: readonly ["concise_professional", "concise_casual", "expanded_professional", "expanded_casual"];
type InboxAgentTone = (typeof INBOX_AGENT_TONES)[number];
interface InboxAgentSettings {
  object: 'inbox_agent';
  instructions: string | null;
  tone: InboxAgentTone | null;
  actions: InboxAgentAction[];
}
//#endregion
//#region src/inboxes/interfaces/inbox.d.ts
export declare const INBOX_MESSAGE_FOLDERS: readonly ["inbox", "archive", "spam", "sent", "trash"];
type InboxMessageFolder = (typeof INBOX_MESSAGE_FOLDERS)[number];
export declare const MOVE_THREAD_FOLDERS: readonly ["inbox", "archive", "spam", "trash"];
type MoveThreadFolder = (typeof MOVE_THREAD_FOLDERS)[number];
/**
 * Hex color in the #RRGGBB format
 *
 * @example '#E93D82'
 */
type InboxLabelColor = string;
type InboxSelector = {
  /** The inbox ID. */
  inboxId: string;
  emailAddress?: never;
} | {
  inboxId?: never;
  /** The inbox email address, such as `support@example.com`. */
  emailAddress: string;
};
interface Inbox {
  id: string;
  name: string | null;
  email_address: string;
  from_name: string | null;
  unread: number;
  last_received: string | null;
  created_at: string;
  updated_at: string;
}
//#endregion
//#region src/inboxes/agent/interfaces/get-inbox-agent.interface.d.ts
type GetInboxAgentOptions = InboxSelector;
type GetInboxAgentResponseSuccess = InboxAgentSettings;
type GetInboxAgentResponse = Response<GetInboxAgentResponseSuccess>;
//#endregion
//#region src/inboxes/agent/interfaces/update-inbox-agent.interface.d.ts
type UpdateInboxAgentOptions = InboxSelector & RequireAtLeastOne<{
  instructions?: string | null;
  tone?: InboxAgentTone | null;
  actions?: InboxAgentAction[];
}>;
interface UpdateInboxAgentResponseSuccess {
  object: 'inbox_agent';
  id: string;
}
type UpdateInboxAgentResponse = Response<UpdateInboxAgentResponseSuccess>;
//#endregion
//#region src/inboxes/drafts/interfaces/draft.d.ts
type InboxDraftType = 'standalone' | 'reply';
interface InboxDraftAttachment {
  id: string;
  filename: string;
  content_type: string;
  size: number;
}
interface InboxDraftAttachmentOptions {
  /** Content of the file, as a base64 string or a Buffer. */
  content: string | Buffer;
  filename: string;
  contentType: string;
}
interface InboxDraft {
  object: 'inbox_draft';
  id: string;
  type: InboxDraftType;
  to: string[] | null;
  cc: string[];
  bcc: string[];
  subject: string | null;
  html: string | null;
  text: string | null;
  thread_id: string | null;
  reply_to_email_id: string | null;
  email_id: string | null;
  created_at: string;
  updated_at: string;
  attachments: InboxDraftAttachment[];
}
interface InboxDraftListItem {
  id: string;
  type: InboxDraftType;
  to: string[] | null;
  cc: string[];
  bcc: string[];
  subject: string | null;
  snippet: string | null;
  thread_id: string | null;
  reply_to_email_id: string | null;
  updated_at: string;
  attachments: InboxDraftAttachment[];
}
//#endregion
//#region src/inboxes/drafts/interfaces/create-inbox-draft.interface.d.ts
type CreateInboxDraftContent = RequireAtLeastOne<{
  to?: string | string[] | null;
  cc?: string | string[] | null;
  bcc?: string | string[] | null;
  subject?: string | null;
  text?: string | null;
  html?: string | null;
  /**
   * Files to store on the draft. Each one needs `content`, `filename` and `contentType`.
   * The files on a draft can total at most 25 MB. An empty file or a blocked file type returns a 422.
   */
  attachments?: InboxDraftAttachmentOptions[];
}>;
type CreateInboxDraftOptions = InboxSelector & CreateInboxDraftContent & ({
  threadId: string;
  replyToEmailId: string;
} | {
  threadId?: never;
  replyToEmailId?: never;
});
interface CreateInboxDraftRequestOptions extends PostOptions, IdempotentRequest {}
interface CreateInboxDraftResponseSuccess {
  object: 'inbox_draft';
  id: string;
}
type CreateInboxDraftResponse = Response<CreateInboxDraftResponseSuccess>;
//#endregion
//#region src/inboxes/drafts/interfaces/get-inbox-draft.interface.d.ts
type GetInboxDraftOptions = InboxSelector & {
  draftId: string;
};
type GetInboxDraftResponseSuccess = InboxDraft;
type GetInboxDraftResponse = Response<GetInboxDraftResponseSuccess>;
//#endregion
//#region src/inboxes/drafts/interfaces/list-inbox-drafts.interface.d.ts
type ListInboxDraftsOptions = InboxSelector & PaginationOptions;
interface ListInboxDraftsResponseSuccess {
  object: 'list';
  has_more: boolean;
  data: InboxDraftListItem[];
}
type ListInboxDraftsResponse = Response<ListInboxDraftsResponseSuccess>;
//#endregion
//#region src/inboxes/drafts/interfaces/remove-inbox-draft.interface.d.ts
type RemoveInboxDraftOptions = InboxSelector & {
  draftId: string;
};
interface RemoveInboxDraftResponseSuccess {
  object: 'inbox_draft';
  id: string;
  deleted: boolean;
}
type RemoveInboxDraftResponse = Response<RemoveInboxDraftResponseSuccess>;
//#endregion
//#region src/inboxes/drafts/interfaces/send-inbox-draft.interface.d.ts
type SendInboxDraftOptions = InboxSelector & {
  draftId: string;
  /**
   * Custom headers to add to the email.
   * The `In-Reply-To`, `References` and `Reply-To` headers are set by Resend and cannot be set here.
   * Sending one of them, in any letter case, returns a 422.
   * Header names cannot be empty, and names and values cannot contain line breaks or null characters, or the request returns a 422.
   * `null` means no custom headers.
   */
  headers?: Record<string, string> | null;
};
interface SendInboxDraftRequestOptions extends PostOptions, IdempotentRequest {}
interface SendInboxDraftResponseSuccess {
  id: string;
}
type SendInboxDraftResponse = Response<SendInboxDraftResponseSuccess>;
//#endregion
//#region src/inboxes/drafts/interfaces/update-inbox-draft.interface.d.ts
type UpdateInboxDraftOptions = InboxSelector & {
  draftId: string;
} & RequireAtLeastOne<{
  to?: string | string[] | null;
  cc?: string | string[] | null;
  bcc?: string | string[] | null;
  subject?: string | null;
  text?: string | null;
  html?: string | null;
  /**
   * Files to store on the draft. Each one needs `content`, `filename` and `contentType`.
   * The files on a draft can total at most 25 MB. An empty file or a blocked file type returns a 422.
   * Sending the field replaces every attachment on the draft. Send `[]` or `null` to remove them all.
   */
  attachments?: InboxDraftAttachmentOptions[] | null;
}>;
interface UpdateInboxDraftResponseSuccess {
  object: 'inbox_draft';
  id: string;
}
type UpdateInboxDraftResponse = Response<UpdateInboxDraftResponseSuccess>;
//#endregion
//#region src/inboxes/labels/interfaces/create-inbox-label.interface.d.ts
type CreateInboxLabelOptions = InboxSelector & {
  name: string;
  color?: InboxLabelColor;
};
interface CreateInboxLabelRequestOptions extends PostOptions {}
interface CreateInboxLabelResponseSuccess {
  object: 'inbox_label';
  id: string;
}
type CreateInboxLabelResponse = Response<CreateInboxLabelResponseSuccess>;
//#endregion
//#region src/inboxes/labels/interfaces/label.d.ts
interface InboxLabel {
  id: string;
  name: string;
  color: InboxLabelColor;
  created_at: string;
}
//#endregion
//#region src/inboxes/labels/interfaces/list-inbox-labels.interface.d.ts
type ListInboxLabelsOptions = InboxSelector;
interface ListInboxLabelsResponseSuccess {
  object: 'list';
  data: InboxLabel[];
}
type ListInboxLabelsResponse = Response<ListInboxLabelsResponseSuccess>;
//#endregion
//#region src/inboxes/labels/interfaces/remove-inbox-label.interface.d.ts
type RemoveInboxLabelOptions = InboxSelector & {
  labelId: string;
};
interface RemoveInboxLabelResponseSuccess {
  object: 'inbox_label';
  id: string;
  deleted: boolean;
}
type RemoveInboxLabelResponse = Response<RemoveInboxLabelResponseSuccess>;
//#endregion
//#region src/inboxes/labels/interfaces/update-inbox-label.interface.d.ts
type UpdateInboxLabelOptions = InboxSelector & {
  labelId: string;
  name?: string;
  color?: InboxLabelColor;
};
interface UpdateInboxLabelResponseSuccess {
  object: 'inbox_label';
  id: string;
}
type UpdateInboxLabelResponse = Response<UpdateInboxLabelResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/thread.d.ts
interface InboxThreadLabel {
  id: string;
  name: string;
  color: InboxLabelColor;
}
interface InboxThreadLabelList {
  object: 'list';
  data: InboxThreadLabel[];
}
interface InboxThread {
  id: string;
  subject: string | null;
  from: string | null;
  to: string[];
  cc: string[];
  bcc: string[];
  labels: InboxThreadLabel[];
  email_count: number;
  has_attachment: boolean;
  has_draft: boolean;
  read: boolean;
  received_at: string;
  folder: InboxMessageFolder;
}
interface InboxThreadSummary {
  object: 'inbox_thread';
  id: string;
  subject: string | null;
  folder: InboxMessageFolder;
  labels: InboxThreadLabel[];
  read: boolean;
}
interface InboxMessageAttachment {
  id: string;
  filename: string | null;
  size: number | null;
}
interface InboxMessage {
  id: string;
  direction: 'inbound' | 'outbound';
  from: string;
  to: string[];
  cc: string[];
  bcc: string[];
  reply_to: string[];
  subject: string | null;
  message_id: string | null;
  html: string | null;
  text: string | null;
  attachments: InboxMessageAttachment[];
  read: boolean;
  received_at: string;
}
//#endregion
//#region src/inboxes/threads/interfaces/add-inbox-thread-labels.interface.d.ts
type AddInboxThreadLabelsOptions = InboxSelector & {
  threadId: string;
  /** Between 1 and 10 label IDs. */
  labels: string[];
};
type AddInboxThreadLabelsResponseSuccess = InboxThreadLabelList;
type AddInboxThreadLabelsResponse = Response<AddInboxThreadLabelsResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/forward-inbox-thread-email.interface.d.ts
type ForwardInboxThreadEmailOptions = InboxSelector & {
  threadId: string;
  emailId: string;
  to: string | string[];
  cc?: string | string[];
  bcc?: string | string[];
  html?: string;
  text?: string;
  subject?: string;
  /**
   * Files to attach, as on `POST /emails`. Each one needs `content` or `path`.
   * They share one limit with the attachments of the original message, which the forward also sends.
   * Together they can have up to 10 files and at most 25 MB of `content`.
   * A `path` file counts toward the 10 files only, because it is fetched when the email is sent.
   * An empty file, a blocked file type, a `path` that is not an `http` or `https` URL or that points to `localhost`, `127.0.0.1` or `0.0.0.0`,
   * or a `content_type` that is not a valid MIME type returns a 422.
   * An original attachment that was sent from a URL (`path`) cannot be forwarded, and the request returns a 422.
   */
  attachments?: Attachment[];
  /**
   * Custom headers to add to the email.
   * The `In-Reply-To`, `References` and `Reply-To` headers are set by Resend and cannot be set here.
   * Sending one of them, in any letter case, returns a 422.
   * Header names cannot be empty, and names and values cannot contain line breaks or null characters, or the request returns a 422.
   * `null` means no custom headers.
   */
  headers?: Record<string, string> | null;
};
interface ForwardInboxThreadEmailRequestOptions extends PostOptions, IdempotentRequest {}
interface ForwardInboxThreadEmailResponseSuccess {
  id: string;
}
type ForwardInboxThreadEmailResponse = Response<ForwardInboxThreadEmailResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/get-inbox-thread.interface.d.ts
type GetInboxThreadOptions = InboxSelector & {
  threadId: string;
};
type GetInboxThreadResponseSuccess = InboxThreadSummary;
type GetInboxThreadResponse = Response<GetInboxThreadResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/get-inbox-thread-email.interface.d.ts
type GetInboxThreadEmailOptions = InboxSelector & {
  threadId: string;
  emailId: string;
};
type GetInboxThreadEmailResponseSuccess = InboxMessage;
type GetInboxThreadEmailResponse = Response<GetInboxThreadEmailResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/list-inbox-thread-emails.interface.d.ts
type ListInboxThreadEmailsOptions = InboxSelector & {
  threadId: string;
} & PaginationOptions;
interface ListInboxThreadEmailsResponseSuccess {
  object: 'list';
  has_more: boolean;
  data: InboxMessage[];
}
type ListInboxThreadEmailsResponse = Response<ListInboxThreadEmailsResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/list-inbox-threads.interface.d.ts
type ListInboxThreadsOptions = InboxSelector & {
  folders?: InboxMessageFolder[];
  labels?: string[];
  read?: boolean;
} & PaginationOptions;
interface ListInboxThreadsResponseSuccess {
  object: 'list';
  has_more: boolean;
  data: InboxThread[];
}
type ListInboxThreadsResponse = Response<ListInboxThreadsResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/remove-inbox-thread.interface.d.ts
type RemoveInboxThreadOptions = InboxSelector & {
  threadId: string;
};
interface RemoveInboxThreadResponseSuccess {
  object: 'inbox_thread';
  id: string;
  deleted: boolean;
}
type RemoveInboxThreadResponse = Response<RemoveInboxThreadResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/remove-inbox-thread-label.interface.d.ts
type RemoveInboxThreadLabelOptions = InboxSelector & {
  threadId: string;
  labelId: string;
};
type RemoveInboxThreadLabelResponseSuccess = InboxThreadLabelList;
type RemoveInboxThreadLabelResponse = Response<RemoveInboxThreadLabelResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/reply-inbox-thread-email.interface.d.ts
type ReplyInboxThreadEmailOptions = InboxSelector & {
  threadId: string;
  emailId: string;
} & RequireAtLeastOne<{
  html?: string;
  text?: string;
}> & {
  cc?: string | string[];
  bcc?: string | string[];
  subject?: string;
  replyAll?: boolean;
  /**
   * Files to attach, as on `POST /emails`. Each one needs `content` or `path`.
   * Up to 10 files. The `content` of all files can total at most 25 MB.
   * A `path` file counts toward the 10 files only, because it is fetched when the email is sent.
   * An empty file, a blocked file type, a `path` that is not an `http` or `https` URL or that points to `localhost`, `127.0.0.1` or `0.0.0.0`,
   * or a `content_type` that is not a valid MIME type returns a 422.
   */
  attachments?: Attachment[];
  /**
   * Custom headers to add to the email.
   * The `In-Reply-To`, `References` and `Reply-To` headers are set by Resend and cannot be set here.
   * Sending one of them, in any letter case, returns a 422.
   * Header names cannot be empty, and names and values cannot contain line breaks or null characters, or the request returns a 422.
   * `null` means no custom headers.
   */
  headers?: Record<string, string> | null;
};
interface ReplyInboxThreadEmailRequestOptions extends PostOptions, IdempotentRequest {}
interface ReplyInboxThreadEmailResponseSuccess {
  id: string;
}
type ReplyInboxThreadEmailResponse = Response<ReplyInboxThreadEmailResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/search-inbox-threads.interface.d.ts
type SearchInboxThreadsOptions = ListInboxThreadsOptions & {
  query?: string;
  from?: string[];
  to?: string[];
  cc?: string[];
  bcc?: string[];
  hasAttachment?: boolean;
  startDate?: string;
  endDate?: string;
};
interface InboxThreadSearchResult extends InboxThread {
  matched_email_id: string | null;
}
interface SearchInboxThreadsResponseSuccess {
  object: 'list';
  has_more: boolean;
  data: InboxThreadSearchResult[];
}
type SearchInboxThreadsResponse = Response<SearchInboxThreadsResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/set-inbox-thread-labels.interface.d.ts
type SetInboxThreadLabelsOptions = InboxSelector & {
  threadId: string;
  labels: string[];
};
type SetInboxThreadLabelsResponseSuccess = InboxThreadLabelList;
type SetInboxThreadLabelsResponse = Response<SetInboxThreadLabelsResponseSuccess>;
//#endregion
//#region src/inboxes/threads/interfaces/update-inbox-thread.interface.d.ts
type UpdateInboxThreadOptions = InboxSelector & {
  threadId: string;
} & RequireAtLeastOne<{
  read?: boolean;
  folder?: MoveThreadFolder;
}>;
type UpdateInboxThreadResponseSuccess = InboxThreadSummary;
type UpdateInboxThreadResponse = Response<UpdateInboxThreadResponseSuccess>;
//#endregion
//#region src/inboxes/interfaces/create-inbox.interface.d.ts
interface CreateInboxOptions {
  emailAddress: string;
  name?: string;
  forwarding?: boolean;
  fromName?: string;
}
interface CreateInboxRequestOptions extends PostOptions {}
interface CreateInboxResponseSuccess {
  object: 'inbox';
  id: string;
}
type CreateInboxResponse = Response<CreateInboxResponseSuccess>;
//#endregion
//#region src/inboxes/interfaces/get-inbox.interface.d.ts
interface GetInboxResponseSuccess {
  object: 'inbox';
  id: string;
  name: string;
  email_address: string;
  domain_id: string;
  receiving_address: string | null;
  from_name: string | null;
  unread: number;
  drafts: number;
  last_received: string | null;
  created_at: string;
  updated_at: string;
}
type GetInboxResponse = Response<GetInboxResponseSuccess>;
//#endregion
//#region src/inboxes/interfaces/list-inboxes.interface.d.ts
type ListInboxesOptions = PaginationOptions;
interface ListInboxesResponseSuccess {
  object: 'list';
  has_more: boolean;
  data: Inbox[];
}
type ListInboxesResponse = Response<ListInboxesResponseSuccess>;
//#endregion
//#region src/inboxes/interfaces/remove-inbox.interface.d.ts
interface RemoveInboxResponseSuccess {
  object: 'inbox';
  id: string;
  deleted: boolean;
}
type RemoveInboxResponse = Response<RemoveInboxResponseSuccess>;
//#endregion
//#region src/inboxes/interfaces/update-inbox.interface.d.ts
type UpdateInboxOptions = RequireAtLeastOne<{
  name?: string;
  fromName?: string;
}>;
interface UpdateInboxResponseSuccess {
  object: 'inbox';
  id: string;
}
type UpdateInboxResponse = Response<UpdateInboxResponseSuccess>;
//#endregion
//#region src/logs/interfaces/log.d.ts
export interface Log {
  id: string;
  created_at: string;
  endpoint: string;
  method: string;
  response_status: number;
  user_agent: string | null;
  request_body: unknown;
  response_body: unknown;
}
//#endregion
//#region src/logs/interfaces/get-log.interface.d.ts
export type GetLogResponseSuccess = {
  object: 'log';
} & Log;
export type GetLogResponse = Response<GetLogResponseSuccess>;
//#endregion
//#region src/logs/interfaces/list-logs.interface.d.ts
export type ListLogsOptions = PaginationOptions;
export type ListLogsResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: Pick<Log, 'id' | 'created_at' | 'endpoint' | 'method' | 'response_status' | 'user_agent'>[];
};
export type ListLogsResponse = Response<ListLogsResponseSuccess>;
//#endregion
//#region src/oauth-grants/interfaces/oauth-grant.d.ts
interface OAuthGrant {
  id: string;
  client_id: string;
  scopes: string[];
  created_at: string;
  revoked_at: string | null;
  revoked_reason: string | null;
  client: {
    name: string;
    logo_uri: string | null;
  };
}
//#endregion
//#region src/oauth-grants/interfaces/list-oauth-grants.interface.d.ts
type ListOAuthGrantsOptions = PaginationOptions;
type ListOAuthGrantsResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: OAuthGrant[];
};
type ListOAuthGrantsResponse = Response<ListOAuthGrantsResponseSuccess>;
//#endregion
//#region src/oauth-grants/interfaces/revoke-oauth-grant.interface.d.ts
type RevokeOAuthGrantResponseSuccess = {
  object: 'oauth_grant';
  id: string;
  revoked_at: string;
  revoked_reason: string;
};
type RevokeOAuthGrantResponse = Response<RevokeOAuthGrantResponseSuccess>;
//#endregion
//#region src/api-keys/api-keys.d.ts
declare class ApiKeys {
  private readonly resend;
  constructor(resend: Resend);
  create(payload: CreateApiKeyOptions, requestOptions?: CreateApiKeyRequestOptions): Promise<CreateApiKeyResponse>;
  list(options?: ListApiKeysOptions, requestOptions?: RequestOptions): Promise<ListApiKeysResponse>;
  update(id: string, payload: UpdateApiKeyOptions, requestOptions?: RequestOptions): Promise<UpdateApiKeyResponse>;
  remove(id: string, requestOptions?: RequestOptions): Promise<RemoveApiKeyResponse>;
}
//#endregion
//#region src/automation-runs/automation-runs.d.ts
declare class AutomationRuns {
  private readonly resend;
  constructor(resend: Resend);
  get(options: GetAutomationRunOptions, requestOptions?: RequestOptions): Promise<GetAutomationRunResponse>;
  list(options: ListAutomationRunsOptions, requestOptions?: RequestOptions): Promise<ListAutomationRunsResponse>;
}
//#endregion
//#region src/automations/automations.d.ts
declare class Automations {
  private readonly resend;
  readonly runs: AutomationRuns;
  constructor(resend: Resend);
  create(payload: CreateAutomationOptions, requestOptions?: RequestOptions): Promise<CreateAutomationResponse>;
  list(options?: ListAutomationsOptions, requestOptions?: RequestOptions): Promise<ListAutomationsResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetAutomationResponse>;
  remove(id: string, requestOptions?: RequestOptions): Promise<RemoveAutomationResponse>;
  update(id: string, payload: UpdateAutomationOptions, requestOptions?: RequestOptions): Promise<UpdateAutomationResponse>;
  duplicate(id: string, requestOptions?: RequestOptions): Promise<DuplicateAutomationResponse>;
  stop(id: string, requestOptions?: RequestOptions): Promise<StopAutomationResponse>;
}
//#endregion
//#region src/batch/batch.d.ts
declare class Batch$1 {
  private readonly resend;
  constructor(resend: Resend);
  send<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, requestOptions?: Options): Promise<CreateBatchResponse<Options>>;
  create<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, requestOptions?: Options): Promise<CreateBatchResponse<Options>>;
}
//#endregion
//#region src/broadcasts/broadcasts.d.ts
declare class Broadcasts {
  private readonly resend;
  constructor(resend: Resend);
  create(payload: CreateBroadcastOptions, requestOptions?: CreateBroadcastRequestOptions): Promise<SendBroadcastResponse>;
  send(id: string, payload?: SendBroadcastOptions, requestOptions?: SendBroadcastRequestOptions): Promise<SendBroadcastResponse>;
  list(options?: ListBroadcastsOptions, requestOptions?: RequestOptions): Promise<ListBroadcastsResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetBroadcastResponse>;
  recipients<T extends BroadcastRecipientEventType>(id: string, options: ListBroadcastRecipientsOptions<T>, requestOptions?: RequestOptions): Promise<ListBroadcastRecipientsResponse<T>>;
  clickedLinks(id: string, options?: ListBroadcastClickedLinksOptions, requestOptions?: RequestOptions): Promise<ListBroadcastClickedLinksResponse>;
  remove(id: string, requestOptions?: RequestOptions): Promise<RemoveBroadcastResponse>;
  cancel(id: string, requestOptions?: RequestOptions): Promise<CancelBroadcastResponse>;
  duplicate(id: string, requestOptions?: RequestOptions): Promise<DuplicateBroadcastResponse>;
  update(id: string, payload: UpdateBroadcastOptions, requestOptions?: RequestOptions): Promise<UpdateBroadcastResponse>;
}
//#endregion
//#region src/contact-properties/contact-properties.d.ts
declare class ContactProperties {
  private readonly resend;
  constructor(resend: Resend);
  create(options: CreateContactPropertyOptions, requestOptions?: RequestOptions): Promise<CreateContactPropertyResponse>;
  list(options?: ListContactPropertiesOptions, requestOptions?: RequestOptions): Promise<ListContactPropertiesResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetContactPropertyResponse>;
  update(payload: UpdateContactPropertyOptions, requestOptions?: RequestOptions): Promise<UpdateContactPropertyResponse>;
  remove(id: string, requestOptions?: RequestOptions): Promise<RemoveContactPropertyResponse>;
}
//#endregion
//#region src/contacts/imports/contact-imports.d.ts
declare class ContactImports {
  private readonly resend;
  constructor(resend: Resend);
  create(payload: CreateContactImportOptions, requestOptions?: CreateContactImportRequestOptions): Promise<CreateContactImportResponse>;
  list(options?: ListContactImportsOptions, requestOptions?: RequestOptions): Promise<ListContactImportsResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetContactImportResponse>;
  private buildCreateFormData;
  private buildColumnMap;
  private appendField;
}
//#endregion
//#region src/contacts/segments/contact-segments.d.ts
declare class ContactSegments {
  private readonly resend;
  constructor(resend: Resend);
  list(options: ListContactSegmentsOptions, requestOptions?: RequestOptions): Promise<ListContactSegmentsResponse>;
  add(options: AddContactSegmentOptions, requestOptions?: RequestOptions): Promise<AddContactSegmentResponse>;
  remove(options: RemoveContactSegmentOptions, requestOptions?: RequestOptions): Promise<RemoveContactSegmentResponse>;
}
//#endregion
//#region src/contacts/topics/contact-topics.d.ts
declare class ContactTopics {
  private readonly resend;
  constructor(resend: Resend);
  update(payload: UpdateContactTopicsOptions, requestOptions?: UpdateContactTopicsRequestOptions): Promise<UpdateContactTopicsResponse>;
  list(options: ListContactTopicsOptions, requestOptions?: ListContactTopicsRequestOptions): Promise<ListContactTopicsResponse>;
}
//#endregion
//#region src/contacts/contacts.d.ts
declare class Contacts {
  private readonly resend;
  readonly imports: ContactImports;
  readonly topics: ContactTopics;
  readonly segments: ContactSegments;
  constructor(resend: Resend);
  create(payload: CreateContactOptions, requestOptions?: CreateContactRequestOptions): Promise<CreateContactResponse>;
  create(payload: LegacyCreateContactOptions, requestOptions?: CreateContactRequestOptions): Promise<CreateContactResponse>;
  list(options?: ListContactsOptions, requestOptions?: RequestOptions): Promise<ListContactsResponse>;
  get(options: GetContactOptions, requestOptions?: RequestOptions): Promise<GetContactResponse>;
  update(options: UpdateContactOptions, requestOptions?: RequestOptions): Promise<UpdateContactResponse>;
  remove(payload: RemoveContactOptions, requestOptions?: RequestOptions): Promise<RemoveContactsResponse>;
}
//#endregion
//#region src/domains/claims/domain-claims.d.ts
declare class DomainClaims {
  private readonly resend;
  constructor(resend: Resend);
  create(payload: ClaimDomainOptions, requestOptions?: ClaimDomainRequestOptions): Promise<ClaimDomainResponse>;
  get(domainId: string, requestOptions?: RequestOptions): Promise<GetDomainClaimResponse>;
  verify(domainId: string, requestOptions?: RequestOptions): Promise<VerifyDomainClaimResponse>;
}
//#endregion
//#region src/domains/domains.d.ts
declare class Domains {
  private readonly resend;
  readonly claims: DomainClaims;
  constructor(resend: Resend);
  create(payload: CreateDomainOptions, requestOptions?: CreateDomainRequestOptions): Promise<CreateDomainResponse>;
  list(options?: ListDomainsOptions, requestOptions?: RequestOptions): Promise<ListDomainsResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetDomainResponse>;
  update(payload: UpdateDomainsOptions, requestOptions?: RequestOptions): Promise<UpdateDomainsResponse>;
  remove(id: string, requestOptions?: RequestOptions): Promise<RemoveDomainsResponse>;
  verify(id: string, requestOptions?: RequestOptions): Promise<VerifyDomainsResponse>;
}
//#endregion
//#region src/emails/attachments/attachments.d.ts
declare class Attachments$1 {
  private readonly resend;
  constructor(resend: Resend);
  get(options: GetAttachmentOptions, requestOptions?: RequestOptions): Promise<GetAttachmentResponse>;
  list(options: ListAttachmentsOptions, requestOptions?: RequestOptions): Promise<ListAttachmentsResponse>;
}
//#endregion
//#region src/emails/receiving/attachments/attachments.d.ts
declare class Attachments {
  private readonly resend;
  constructor(resend: Resend);
  get(options: GetAttachmentOptions, requestOptions?: RequestOptions): Promise<GetAttachmentResponse>;
  list(options: ListAttachmentsOptions, requestOptions?: RequestOptions): Promise<ListAttachmentsResponse>;
}
//#endregion
//#region src/emails/receiving/receiving.d.ts
declare class Receiving {
  private readonly resend;
  readonly attachments: Attachments;
  constructor(resend: Resend);
  get(id: string, options?: GetReceivingEmailOptions, requestOptions?: RequestOptions): Promise<GetReceivingEmailResponse>;
  list(options?: ListReceivingEmailsOptions, requestOptions?: RequestOptions): Promise<ListReceivingEmailsResponse>;
  forward(options: ForwardReceivingEmailOptions, requestOptions?: ForwardReceivingEmailRequestOptions): Promise<ForwardReceivingEmailResponse>;
  private forwardPassthrough;
  private forwardWrapped;
  private downloadRaw;
}
//#endregion
//#region src/emails/emails.d.ts
declare class Emails {
  private readonly resend;
  readonly attachments: Attachments$1;
  readonly receiving: Receiving;
  constructor(resend: Resend);
  send(payload: CreateEmailOptions, requestOptions?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
  create(payload: CreateEmailOptions, requestOptions?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetEmailResponse>;
  list(options?: ListEmailsOptions, requestOptions?: RequestOptions): Promise<ListEmailsResponse>;
  update(payload: UpdateEmailOptions, requestOptions?: RequestOptions): Promise<UpdateEmailResponse>;
  cancel(id: string, requestOptions?: RequestOptions): Promise<CancelEmailResponse>;
  share(id: string, payload?: ShareEmailOptions, requestOptions?: RequestOptions): Promise<ShareEmailResponse>;
  metrics(options?: GetEmailsMetricsOptions, requestOptions?: RequestOptions): Promise<GetEmailsMetricsResponse>;
}
//#endregion
//#region src/events/events.d.ts
declare class Events$1 {
  private readonly resend;
  constructor(resend: Resend);
  send(payload: SendEventOptions, requestOptions?: RequestOptions): Promise<SendEventResponse>;
  create(payload: CreateEventOptions, requestOptions?: RequestOptions): Promise<CreateEventResponse>;
  get(identifier: string, requestOptions?: RequestOptions): Promise<GetEventResponse>;
  list(options?: ListEventsOptions, requestOptions?: RequestOptions): Promise<ListEventsResponse>;
  update(identifier: string, payload: UpdateEventOptions, requestOptions?: RequestOptions): Promise<UpdateEventResponse>;
  remove(identifier: string, requestOptions?: RequestOptions): Promise<RemoveEventResponse>;
}
//#endregion
//#region src/inboxes/agent/agent.d.ts
declare class InboxAgent {
  private readonly resend;
  constructor(resend: Resend);
  get(options: GetInboxAgentOptions, requestOptions?: RequestOptions): Promise<GetInboxAgentResponse>;
  update(options: UpdateInboxAgentOptions, requestOptions?: RequestOptions): Promise<UpdateInboxAgentResponse>;
}
//#endregion
//#region src/inboxes/drafts/drafts.d.ts
declare class InboxDrafts {
  private readonly resend;
  constructor(resend: Resend);
  list(options: ListInboxDraftsOptions, requestOptions?: RequestOptions): Promise<ListInboxDraftsResponse>;
  create(payload: CreateInboxDraftOptions, options?: CreateInboxDraftRequestOptions): Promise<CreateInboxDraftResponse>;
  get(options: GetInboxDraftOptions, requestOptions?: RequestOptions): Promise<GetInboxDraftResponse>;
  update(options: UpdateInboxDraftOptions, requestOptions?: RequestOptions): Promise<UpdateInboxDraftResponse>;
  remove(options: RemoveInboxDraftOptions, requestOptions?: RequestOptions): Promise<RemoveInboxDraftResponse>;
  send(payload: SendInboxDraftOptions, options?: SendInboxDraftRequestOptions): Promise<SendInboxDraftResponse>;
}
//#endregion
//#region src/inboxes/labels/labels.d.ts
declare class InboxLabels {
  private readonly resend;
  constructor(resend: Resend);
  list(options: ListInboxLabelsOptions, requestOptions?: RequestOptions): Promise<ListInboxLabelsResponse>;
  create(payload: CreateInboxLabelOptions, options?: CreateInboxLabelRequestOptions): Promise<CreateInboxLabelResponse>;
  update(options: UpdateInboxLabelOptions, requestOptions?: RequestOptions): Promise<UpdateInboxLabelResponse>;
  remove(options: RemoveInboxLabelOptions, requestOptions?: RequestOptions): Promise<RemoveInboxLabelResponse>;
}
//#endregion
//#region src/inboxes/threads/emails/emails.d.ts
declare class InboxThreadEmails {
  private readonly resend;
  constructor(resend: Resend);
  list(options: ListInboxThreadEmailsOptions, requestOptions?: RequestOptions): Promise<ListInboxThreadEmailsResponse>;
  get(options: GetInboxThreadEmailOptions, requestOptions?: RequestOptions): Promise<GetInboxThreadEmailResponse>;
  reply(payload: ReplyInboxThreadEmailOptions, options?: ReplyInboxThreadEmailRequestOptions): Promise<ReplyInboxThreadEmailResponse>;
  forward(payload: ForwardInboxThreadEmailOptions, options?: ForwardInboxThreadEmailRequestOptions): Promise<ForwardInboxThreadEmailResponse>;
}
//#endregion
//#region src/inboxes/threads/labels/labels.d.ts
declare class InboxThreadLabels {
  private readonly resend;
  constructor(resend: Resend);
  add(options: AddInboxThreadLabelsOptions, requestOptions?: RequestOptions): Promise<AddInboxThreadLabelsResponse>;
  set(options: SetInboxThreadLabelsOptions, requestOptions?: RequestOptions): Promise<SetInboxThreadLabelsResponse>;
  remove(options: RemoveInboxThreadLabelOptions, requestOptions?: RequestOptions): Promise<RemoveInboxThreadLabelResponse>;
}
//#endregion
//#region src/inboxes/threads/threads.d.ts
declare class InboxThreads {
  private readonly resend;
  readonly emails: InboxThreadEmails;
  readonly labels: InboxThreadLabels;
  constructor(resend: Resend);
  list(options: ListInboxThreadsOptions, requestOptions?: RequestOptions): Promise<ListInboxThreadsResponse>;
  search(options: SearchInboxThreadsOptions, requestOptions?: RequestOptions): Promise<SearchInboxThreadsResponse>;
  get(options: GetInboxThreadOptions, requestOptions?: RequestOptions): Promise<GetInboxThreadResponse>;
  update(options: UpdateInboxThreadOptions, requestOptions?: RequestOptions): Promise<UpdateInboxThreadResponse>;
  remove(options: RemoveInboxThreadOptions, requestOptions?: RequestOptions): Promise<RemoveInboxThreadResponse>;
}
//#endregion
//#region src/inboxes/inboxes.d.ts
declare class Inboxes {
  private readonly resend;
  readonly threads: InboxThreads;
  readonly labels: InboxLabels;
  readonly drafts: InboxDrafts;
  readonly agent: InboxAgent;
  constructor(resend: Resend);
  create(payload: CreateInboxOptions, options?: CreateInboxRequestOptions): Promise<CreateInboxResponse>;
  list(options?: ListInboxesOptions, requestOptions?: RequestOptions): Promise<ListInboxesResponse>;
  get(idOrEmail: string, requestOptions?: RequestOptions): Promise<GetInboxResponse>;
  update(idOrEmail: string, payload: UpdateInboxOptions, requestOptions?: RequestOptions): Promise<UpdateInboxResponse>;
  remove(idOrEmail: string, requestOptions?: RequestOptions): Promise<RemoveInboxResponse>;
}
//#endregion
//#region src/logs/logs.d.ts
declare class Logs {
  private readonly resend;
  constructor(resend: Resend);
  list(options?: ListLogsOptions, requestOptions?: RequestOptions): Promise<ListLogsResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetLogResponse>;
}
//#endregion
//#region src/oauth-grants/oauth-grants.d.ts
declare class OAuthGrants {
  private readonly resend;
  constructor(resend: Resend);
  list(options?: ListOAuthGrantsOptions, requestOptions?: RequestOptions): Promise<ListOAuthGrantsResponse>;
  revoke(id: string, requestOptions?: RequestOptions): Promise<RevokeOAuthGrantResponse>;
}
//#endregion
//#region src/segments/interfaces/create-segment-options.interface.d.ts
export interface CreateSegmentOptions {
  name: string;
}
export interface CreateSegmentRequestOptions extends PostOptions {}
export interface CreateSegmentResponseSuccess extends Pick<Segment, 'name' | 'id'> {
  object: 'segment';
}
export type CreateSegmentResponse = Response<CreateSegmentResponseSuccess>;
//#endregion
//#region src/segments/interfaces/get-segment.interface.d.ts
export interface GetSegmentResponseSuccess extends Pick<Segment, 'id' | 'name' | 'created_at'> {
  object: 'segment';
}
export type GetSegmentResponse = Response<GetSegmentResponseSuccess>;
//#endregion
//#region src/segments/interfaces/list-segments.interface.d.ts
export type ListSegmentsOptions = PaginationOptions;
export type ListSegmentsResponseSuccess = {
  object: 'list';
  data: Segment[];
  has_more: boolean;
};
export type ListSegmentsResponse = Response<ListSegmentsResponseSuccess>;
//#endregion
//#region src/segments/interfaces/remove-segment.interface.d.ts
export interface RemoveSegmentResponseSuccess extends Pick<Segment, 'id'> {
  object: 'segment';
  deleted: boolean;
}
export type RemoveSegmentResponse = Response<RemoveSegmentResponseSuccess>;
//#endregion
//#region src/segments/interfaces/update-segment.interface.d.ts
export interface UpdateSegmentOptions {
  name: string;
}
export interface UpdateSegmentResponseSuccess extends Pick<Segment, 'id'> {
  object: 'segment';
}
export type UpdateSegmentResponse = Response<UpdateSegmentResponseSuccess>;
//#endregion
//#region src/segments/segments.d.ts
declare class Segments {
  private readonly resend;
  constructor(resend: Resend);
  create(payload: CreateSegmentOptions, requestOptions?: CreateSegmentRequestOptions): Promise<CreateSegmentResponse>;
  list(options?: ListSegmentsOptions, requestOptions?: RequestOptions): Promise<ListSegmentsResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetSegmentResponse>;
  update(id: string, payload: UpdateSegmentOptions, requestOptions?: RequestOptions): Promise<UpdateSegmentResponse>;
  remove(id: string, requestOptions?: RequestOptions): Promise<RemoveSegmentResponse>;
}
//#endregion
//#region src/suppressions/batch/interfaces/batch-add-suppressions.interface.d.ts
export interface BatchAddSuppressionsOptions {
  emails: string[];
}
export interface BatchAddSuppressionsResponseSuccess {
  data: {
    object: 'suppression';
    id: string;
  }[];
}
export type BatchAddSuppressionsResponse = Response<BatchAddSuppressionsResponseSuccess>;
//#endregion
//#region src/suppressions/batch/interfaces/batch-remove-suppressions.interface.d.ts
export type BatchRemoveSuppressionsOptions = {
  emails: string[];
  ids?: never;
} | {
  ids: string[];
  emails?: never;
};
export interface BatchRemoveSuppressionsResponseSuccess {
  data: {
    object: 'suppression';
    id: string;
    deleted: boolean;
  }[];
}
export type BatchRemoveSuppressionsResponse = Response<BatchRemoveSuppressionsResponseSuccess>;
//#endregion
//#region src/suppressions/batch/batch.d.ts
declare class Batch {
  private readonly resend;
  constructor(resend: Resend);
  add(options: BatchAddSuppressionsOptions, requestOptions?: RequestOptions): Promise<BatchAddSuppressionsResponse>;
  remove(options: BatchRemoveSuppressionsOptions, requestOptions?: RequestOptions): Promise<BatchRemoveSuppressionsResponse>;
}
//#endregion
//#region src/suppressions/interfaces/add-suppression.interface.d.ts
export interface AddSuppressionOptions {
  email: string;
}
export interface AddSuppressionResponseSuccess {
  object: 'suppression';
  id: string;
}
export type AddSuppressionResponse = Response<AddSuppressionResponseSuccess>;
//#endregion
//#region src/suppressions/interfaces/suppression-list-entry.d.ts
export type SuppressionOrigin = 'bounce' | 'complaint' | 'manual';
export interface Suppression {
  object: 'suppression';
  id: string;
  email: string;
  origin: SuppressionOrigin;
  source_id: string | null;
  created_at: string;
}
export type SuppressionListEntry = Omit<Suppression, 'object'>;
//#endregion
//#region src/suppressions/interfaces/get-suppression.interface.d.ts
export type GetSuppressionResponseSuccess = Suppression;
export type GetSuppressionResponse = Response<GetSuppressionResponseSuccess>;
//#endregion
//#region src/suppressions/interfaces/list-suppressions.interface.d.ts
export type ListSuppressionsOptions = PaginationOptions & {
  origin?: SuppressionOrigin;
};
export type ListSuppressionsResponseSuccess = PaginatedData<SuppressionListEntry[]>;
export type ListSuppressionsResponse = Response<ListSuppressionsResponseSuccess>;
//#endregion
//#region src/suppressions/interfaces/remove-suppression.interface.d.ts
export interface RemoveSuppressionResponseSuccess {
  object: 'suppression';
  id: string;
  deleted: boolean;
}
export type RemoveSuppressionResponse = Response<RemoveSuppressionResponseSuccess>;
//#endregion
//#region src/suppressions/suppressions.d.ts
declare class Suppressions {
  private readonly resend;
  readonly batch: Batch;
  constructor(resend: Resend);
  add(options: AddSuppressionOptions, requestOptions?: RequestOptions): Promise<AddSuppressionResponse>;
  list(options?: ListSuppressionsOptions, requestOptions?: RequestOptions): Promise<ListSuppressionsResponse>;
  get(idOrEmail: string, requestOptions?: RequestOptions): Promise<GetSuppressionResponse>;
  remove(idOrEmail: string, requestOptions?: RequestOptions): Promise<RemoveSuppressionResponse>;
}
//#endregion
//#region src/templates/interfaces/template.d.ts
export interface Template {
  id: string;
  name: string;
  subject: string | null;
  html: string;
  text: string | null;
  status: 'draft' | 'published';
  variables: TemplateVariable[] | null;
  alias: string | null;
  from: string | null;
  reply_to: string[] | null;
  published_at: string | null;
  created_at: string;
  updated_at: string;
  has_unpublished_versions: boolean;
  current_version_id: string;
}
export interface TemplateVariable {
  key: string;
  fallback_value: string | number | null;
  type: 'string' | 'number';
  created_at: string;
  updated_at: string;
}
//#endregion
//#region src/templates/interfaces/create-template-options.interface.d.ts
type TemplateContentCreationOptions = RequireAtLeastOne<{
  html: string;
  react: React.ReactNode;
}>;
type TemplateVariableCreationOptions = Pick<TemplateVariable, 'key' | 'type'> & ({
  type: 'string';
  fallbackValue?: string | null;
} | {
  type: 'number';
  fallbackValue?: number | null;
});
type TemplateOptionalFieldsForCreation = Partial<Pick<Template, 'subject' | 'text' | 'alias' | 'from'>> & {
  replyTo?: string[] | string;
  variables?: TemplateVariableCreationOptions[];
};
export type CreateTemplateOptions = Pick<Template, 'name'> & TemplateOptionalFieldsForCreation & TemplateContentCreationOptions;
export interface CreateTemplateRequestOptions extends PostOptions {}
export interface CreateTemplateResponseSuccess extends Pick<Template, 'id'> {
  object: 'template';
}
export type CreateTemplateResponse = Response<CreateTemplateResponseSuccess>;
//#endregion
//#region src/templates/interfaces/duplicate-template.interface.d.ts
export interface DuplicateTemplateResponseSuccess extends Pick<Template, 'id'> {
  object: 'template';
}
export type DuplicateTemplateResponse = Response<DuplicateTemplateResponseSuccess>;
//#endregion
//#region src/templates/interfaces/publish-template.interface.d.ts
export interface PublishTemplateResponseSuccess extends Pick<Template, 'id'> {
  object: 'template';
}
export type PublishTemplateResponse = Response<PublishTemplateResponseSuccess>;
//#endregion
//#region src/templates/chainable-template-result.d.ts
declare class ChainableTemplateResult<T extends CreateTemplateResponse | DuplicateTemplateResponse> implements PromiseLike<T> {
  private readonly promise;
  private readonly publishFn;
  constructor(promise: Promise<T>, publishFn: (id: string, requestOptions?: RequestOptions) => Promise<PublishTemplateResponse>);
  then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
  publish(requestOptions?: RequestOptions): Promise<PublishTemplateResponse>;
}
//#endregion
//#region src/templates/interfaces/get-template.interface.d.ts
export interface GetTemplateResponseSuccess extends Template {
  object: 'template';
}
export type GetTemplateResponse = Response<GetTemplateResponseSuccess>;
//#endregion
//#region src/templates/interfaces/list-templates.interface.d.ts
export type ListTemplatesOptions = PaginationOptions;
interface TemplateListItem extends Pick<Template, 'id' | 'name' | 'created_at' | 'updated_at' | 'status' | 'published_at' | 'alias'> {}
export interface ListTemplatesResponseSuccess {
  object: 'list';
  data: TemplateListItem[];
  has_more: boolean;
}
export type ListTemplatesResponse = Response<ListTemplatesResponseSuccess>;
//#endregion
//#region src/templates/interfaces/remove-template.interface.d.ts
export interface RemoveTemplateResponseSuccess {
  object: 'template';
  id: string;
  deleted: boolean;
}
export type RemoveTemplateResponse = Response<RemoveTemplateResponseSuccess>;
//#endregion
//#region src/templates/interfaces/update-template.interface.d.ts
type TemplateVariableUpdateOptions = Pick<TemplateVariable, 'key' | 'type'> & ({
  type: 'string';
  fallbackValue?: string | null;
} | {
  type: 'number';
  fallbackValue?: number | null;
});
export interface UpdateTemplateOptions extends Partial<Pick<Template, 'name' | 'subject' | 'html' | 'text' | 'from' | 'alias'>> {
  variables?: TemplateVariableUpdateOptions[];
  replyTo?: string[] | string;
}
export interface UpdateTemplateResponseSuccess extends Pick<Template, 'id'> {
  object: 'template';
}
export type UpdateTemplateResponse = Response<UpdateTemplateResponseSuccess>;
//#endregion
//#region src/templates/templates.d.ts
declare class Templates {
  private readonly resend;
  constructor(resend: Resend);
  create(payload: CreateTemplateOptions, requestOptions?: CreateTemplateRequestOptions): ChainableTemplateResult<CreateTemplateResponse>;
  private performCreate;
  remove(identifier: string, requestOptions?: RequestOptions): Promise<RemoveTemplateResponse>;
  get(identifier: string, requestOptions?: RequestOptions): Promise<GetTemplateResponse>;
  list(options?: PaginationOptions, requestOptions?: RequestOptions): Promise<ListTemplatesResponse>;
  duplicate(identifier: string, requestOptions?: RequestOptions): ChainableTemplateResult<DuplicateTemplateResponse>;
  publish(identifier: string, requestOptions?: RequestOptions): Promise<PublishTemplateResponse>;
  update(identifier: string, payload: UpdateTemplateOptions, requestOptions?: RequestOptions): Promise<UpdateTemplateResponse>;
}
//#endregion
//#region src/topics/interfaces/topic.d.ts
export interface Topic {
  id: string;
  name: string;
  description?: string;
  default_subscription: 'opt_in' | 'opt_out';
  created_at: string;
}
//#endregion
//#region src/topics/interfaces/create-topic-options.interface.d.ts
export interface CreateTopicOptions {
  name: string;
  description?: string;
  defaultSubscription: 'opt_in' | 'opt_out';
}
export type CreateTopicResponseSuccess = Pick<Topic, 'id'>;
export type CreateTopicResponse = Response<CreateTopicResponseSuccess>;
//#endregion
//#region src/topics/interfaces/get-topic.interface.d.ts
export interface GetTopicOptions {
  id: string;
}
export type GetTopicResponseSuccess = Topic;
export type GetTopicResponse = Response<GetTopicResponseSuccess>;
//#endregion
//#region src/topics/interfaces/list-topics.interface.d.ts
export interface ListTopicsResponseSuccess {
  data: Topic[];
}
export type ListTopicsResponse = Response<ListTopicsResponseSuccess>;
//#endregion
//#region src/topics/interfaces/remove-topic.interface.d.ts
export type RemoveTopicResponseSuccess = Pick<Topic, 'id'> & {
  object: 'topic';
  deleted: boolean;
};
export type RemoveTopicResponse = Response<RemoveTopicResponseSuccess>;
//#endregion
//#region src/topics/interfaces/update-topic.interface.d.ts
export interface UpdateTopicOptions {
  id: string;
  name?: string;
  description?: string;
}
export type UpdateTopicResponseSuccess = Pick<Topic, 'id'>;
export type UpdateTopicResponse = Response<UpdateTopicResponseSuccess>;
//#endregion
//#region src/topics/topics.d.ts
declare class Topics {
  private readonly resend;
  constructor(resend: Resend);
  create(payload: CreateTopicOptions, requestOptions?: RequestOptions): Promise<CreateTopicResponse>;
  list(requestOptions?: RequestOptions): Promise<ListTopicsResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetTopicResponse>;
  update(payload: UpdateTopicOptions, requestOptions?: RequestOptions): Promise<UpdateTopicResponse>;
  remove(id: string, requestOptions?: RequestOptions): Promise<RemoveTopicResponse>;
}
//#endregion
//#region src/usage/interfaces/get-usage.interface.d.ts
export type GetUsageResponseSuccess = {
  object: 'usage';
  emails: {
    daily: {
      used: number;
      limit: number | null;
      sent: number;
      received: number;
      resets_at: string;
    };
    monthly: {
      used: number;
      limit: number;
      sent: number;
      received: number;
      resets_at: string;
    };
  };
  contacts: {
    used: number;
    limit: number;
  };
  segments: {
    used: number;
    limit: number | null;
  };
  broadcasts: {
    used: number;
    limit: null;
  };
  ai_credits: {
    used: number;
    limit: number | null;
    next_increase_at: string | null;
  };
  automation_runs: {
    used: number;
    limit: number;
    resets_at: string;
  };
  domains: {
    used: number;
    limit: number | null;
  };
  rate_limit: {
    limit: number;
    duration: string;
  };
};
export type GetUsageResponse = Response<GetUsageResponseSuccess>;
//#endregion
//#region src/usage/usage.d.ts
declare class Usage {
  private readonly resend;
  constructor(resend: Resend);
  get(requestOptions?: RequestOptions): Promise<GetUsageResponse>;
}
//#endregion
//#region src/webhooks/interfaces/webhook-event.interface.d.ts
type WebhookEvent = 'email.sent' | 'email.scheduled' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'email.suppressed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'contact.topics.updated' | 'domain.created' | 'domain.updated' | 'domain.deleted' | 'suppression.added' | 'suppression.removed' | 'topic.created' | 'topic.updated' | 'topic.deleted' | 'inbox.created' | 'inbox.updated' | 'inbox.deleted' | 'inbox.thread.created' | 'inbox.thread.folder.updated' | 'inbox.thread.assigned' | 'inbox.thread.unassigned' | 'inbox.thread.labels.updated' | 'inbox.email.received' | 'inbox.email.sent' | 'inbox.draft.created' | 'inbox.draft.updated' | 'inbox.draft.sent' | 'inbox.draft.deleted';
interface BaseEmailEventData {
  broadcast_id?: string;
  created_at: string;
  email_id: string;
  message_id: string;
  from: string;
  to: string[];
  subject: string;
  template_id?: string;
  tags?: Record<string, string>;
}
interface EmailBounce {
  message: string;
  subType: string;
  type: string;
}
interface EmailClick {
  ipAddress: string;
  link: string;
  timestamp: string;
  userAgent: string;
}
interface EmailFailed {
  reason: string;
}
interface EmailSuppressed {
  message: string;
  type: string;
}
interface ReceivedEmailAttachment {
  id: string;
  filename: string | null;
  content_type: string;
  content_disposition: string | null;
  content_id: string | null;
}
interface ReceivedEmailEventData {
  email_id: string;
  created_at: string;
  from: string;
  to: string[];
  bcc: string[];
  cc: string[];
  received_for: string[];
  message_id: string;
  subject: string;
  attachments: ReceivedEmailAttachment[];
}
interface ContactEventData {
  id: string;
  audience_id: string;
  segment_ids: string[];
  created_at: string;
  updated_at: string;
  email: string;
  first_name?: string | null;
  last_name?: string | null;
  unsubscribed: boolean;
}
interface ContactTopicsEventData {
  email: string;
  topics: {
    id: string;
    subscription: 'opt_in' | 'opt_out';
  }[];
}
interface DomainRecord {
  record: string;
  name: string;
  type: string;
  ttl: string;
  status: string;
  value: string;
  priority?: number;
}
interface DomainEventData {
  id: string;
  name: string;
  status: string;
  created_at: string;
  region: string;
  records: DomainRecord[];
}
interface SuppressionEventData {
  id: string;
  email: string;
  origin: 'bounce' | 'complaint' | 'manual';
  source_id: string | null;
  created_at: string;
}
interface TopicEventData {
  id: string;
  name: string;
  description: string | null;
  default_subscription: 'opt_in' | 'opt_out';
  deleted: boolean;
  created_at: string;
  updated_at: string;
}
type InboxEventSource = 'api' | 'dashboard' | 'agent' | 'system';
type InboxEventEmail = Omit<InboxMessage, 'html' | 'text'>;
type InboxEventDraft = Omit<InboxDraft, 'html' | 'text'>;
interface InboxBaseEventData {
  source: InboxEventSource;
  inbox_id: string;
}
interface InboxEventData extends InboxBaseEventData {
  inbox?: GetInboxResponseSuccess;
}
interface InboxThreadEventData extends InboxBaseEventData {
  thread_id: string;
  thread?: InboxThreadSummary;
}
interface InboxThreadEmailEventData extends InboxThreadEventData {
  email_id: string;
  email?: InboxEventEmail;
}
interface InboxThreadFolderUpdatedEventData extends InboxThreadEventData {
  from: MoveThreadFolder;
  to: MoveThreadFolder;
}
interface InboxThreadAssignedEventData extends InboxThreadEventData {
  assignee_email: string | null;
  assigned_by_email: string | null;
  previous_assignee_email: string | null;
}
interface InboxThreadUnassignedEventData extends InboxThreadEventData {
  previous_assignee_email: string | null;
}
interface InboxThreadLabelsUpdatedEventData extends InboxThreadEventData {
  added: InboxThreadLabel[];
  removed: InboxThreadLabel[];
}
interface InboxDraftEventData extends InboxBaseEventData {
  thread_id?: string;
  draft_id: string;
  thread?: InboxThreadSummary;
  draft?: InboxEventDraft;
}
interface InboxDraftSentEventData extends InboxThreadEmailEventData {
  draft_id: string;
  draft?: InboxEventDraft;
}
interface EmailSentEvent {
  type: 'email.sent';
  created_at: string;
  data: BaseEmailEventData;
}
interface EmailScheduledEvent {
  type: 'email.scheduled';
  created_at: string;
  data: BaseEmailEventData;
}
interface EmailDeliveredEvent {
  type: 'email.delivered';
  created_at: string;
  data: BaseEmailEventData;
}
interface EmailDeliveryDelayedEvent {
  type: 'email.delivery_delayed';
  created_at: string;
  data: BaseEmailEventData;
}
interface EmailComplainedEvent {
  type: 'email.complained';
  created_at: string;
  data: BaseEmailEventData;
}
interface EmailBouncedEvent {
  type: 'email.bounced';
  created_at: string;
  data: BaseEmailEventData & {
    bounce: EmailBounce;
  };
}
interface EmailOpenedEvent {
  type: 'email.opened';
  created_at: string;
  data: BaseEmailEventData;
}
interface EmailClickedEvent {
  type: 'email.clicked';
  created_at: string;
  data: BaseEmailEventData & {
    click: EmailClick;
  };
}
interface EmailReceivedEvent {
  type: 'email.received';
  created_at: string;
  data: ReceivedEmailEventData;
}
interface EmailFailedEvent {
  type: 'email.failed';
  created_at: string;
  data: BaseEmailEventData & {
    failed: EmailFailed;
  };
}
interface EmailSuppressedEvent {
  type: 'email.suppressed';
  created_at: string;
  data: BaseEmailEventData & {
    suppressed: EmailSuppressed;
  };
}
interface ContactCreatedEvent {
  type: 'contact.created';
  created_at: string;
  data: ContactEventData;
}
interface ContactUpdatedEvent {
  type: 'contact.updated';
  created_at: string;
  data: ContactEventData;
}
interface ContactDeletedEvent {
  type: 'contact.deleted';
  created_at: string;
  data: ContactEventData;
}
interface ContactTopicsUpdatedEvent {
  type: 'contact.topics.updated';
  created_at: string;
  data: ContactTopicsEventData;
}
interface DomainCreatedEvent {
  type: 'domain.created';
  created_at: string;
  data: DomainEventData;
}
interface DomainUpdatedEvent {
  type: 'domain.updated';
  created_at: string;
  data: DomainEventData;
}
interface DomainDeletedEvent {
  type: 'domain.deleted';
  created_at: string;
  data: DomainEventData;
}
interface SuppressionAddedEvent {
  type: 'suppression.added';
  created_at: string;
  data: SuppressionEventData;
}
interface SuppressionRemovedEvent {
  type: 'suppression.removed';
  created_at: string;
  data: SuppressionEventData;
}
interface TopicCreatedEvent {
  type: 'topic.created';
  created_at: string;
  data: TopicEventData;
}
interface TopicUpdatedEvent {
  type: 'topic.updated';
  created_at: string;
  data: TopicEventData;
}
interface TopicDeletedEvent {
  type: 'topic.deleted';
  created_at: string;
  data: TopicEventData;
}
interface InboxCreatedEvent {
  type: 'inbox.created';
  created_at: string;
  data: InboxEventData;
}
interface InboxUpdatedEvent {
  type: 'inbox.updated';
  created_at: string;
  data: InboxEventData;
}
interface InboxDeletedEvent {
  type: 'inbox.deleted';
  created_at: string;
  data: InboxBaseEventData;
}
interface InboxThreadCreatedEvent {
  type: 'inbox.thread.created';
  created_at: string;
  data: InboxThreadEmailEventData;
}
interface InboxThreadFolderUpdatedEvent {
  type: 'inbox.thread.folder.updated';
  created_at: string;
  data: InboxThreadFolderUpdatedEventData;
}
interface InboxThreadAssignedEvent {
  type: 'inbox.thread.assigned';
  created_at: string;
  data: InboxThreadAssignedEventData;
}
interface InboxThreadUnassignedEvent {
  type: 'inbox.thread.unassigned';
  created_at: string;
  data: InboxThreadUnassignedEventData;
}
interface InboxThreadLabelsUpdatedEvent {
  type: 'inbox.thread.labels.updated';
  created_at: string;
  data: InboxThreadLabelsUpdatedEventData;
}
interface InboxEmailReceivedEvent {
  type: 'inbox.email.received';
  created_at: string;
  data: InboxThreadEmailEventData;
}
interface InboxEmailSentEvent {
  type: 'inbox.email.sent';
  created_at: string;
  data: InboxThreadEmailEventData;
}
interface InboxDraftCreatedEvent {
  type: 'inbox.draft.created';
  created_at: string;
  data: InboxDraftEventData;
}
interface InboxDraftUpdatedEvent {
  type: 'inbox.draft.updated';
  created_at: string;
  data: InboxDraftEventData;
}
interface InboxDraftSentEvent {
  type: 'inbox.draft.sent';
  created_at: string;
  data: InboxDraftSentEventData;
}
interface InboxDraftDeletedEvent {
  type: 'inbox.draft.deleted';
  created_at: string;
  data: InboxDraftEventData;
}
type WebhookEventPayload = EmailSentEvent | EmailScheduledEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailComplainedEvent | EmailBouncedEvent | EmailOpenedEvent | EmailClickedEvent | EmailReceivedEvent | EmailFailedEvent | EmailSuppressedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | ContactTopicsUpdatedEvent | DomainCreatedEvent | DomainUpdatedEvent | DomainDeletedEvent | SuppressionAddedEvent | SuppressionRemovedEvent | TopicCreatedEvent | TopicUpdatedEvent | TopicDeletedEvent | InboxCreatedEvent | InboxUpdatedEvent | InboxDeletedEvent | InboxThreadCreatedEvent | InboxThreadFolderUpdatedEvent | InboxThreadAssignedEvent | InboxThreadUnassignedEvent | InboxThreadLabelsUpdatedEvent | InboxEmailReceivedEvent | InboxEmailSentEvent | InboxDraftCreatedEvent | InboxDraftUpdatedEvent | InboxDraftSentEvent | InboxDraftDeletedEvent;
//#endregion
//#region src/webhooks/interfaces/list-webhook-events.interface.d.ts
type WebhookEventLogStatus = 'success' | 'pending' | 'failed' | 'attempting';
interface WebhookEventLog {
  id: string;
  type: WebhookEvent;
  created_at: string;
  status: WebhookEventLogStatus;
}
type ListWebhookEventsOptions = {
  webhookId: string;
  limit?: number;
  after?: string;
};
type ListWebhookEventsResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: WebhookEventLog[];
};
type ListWebhookEventsResponse = Response<ListWebhookEventsResponseSuccess>;
//#endregion
//#region src/webhooks/interfaces/get-webhook-event.interface.d.ts
interface GetWebhookEventOptions {
  webhookId: string;
  eventId: string;
}
interface GetWebhookEventResponseSuccess {
  object: 'webhook_event';
  id: string;
  type: WebhookEvent;
  created_at: string;
  status: WebhookEventLogStatus;
  next_attempt_at: string | null;
  payload: WebhookEventPayload;
}
type GetWebhookEventResponse = Response<GetWebhookEventResponseSuccess>;
//#endregion
//#region src/webhooks/interfaces/replay-webhook-event.interface.d.ts
interface ReplayWebhookEventOptions {
  webhookId: string;
  eventId: string;
}
interface ReplayWebhookEventResponseSuccess {
  object: 'webhook_event';
  id: string;
}
type ReplayWebhookEventResponse = Response<ReplayWebhookEventResponseSuccess>;
//#endregion
//#region src/webhooks/interfaces/list-webhook-event-attempts.interface.d.ts
interface WebhookEventAttempt {
  id: string;
  http_status_code: number;
  response: string;
  sent_at: string;
}
type ListWebhookEventAttemptsOptions = {
  webhookId: string;
  eventId: string;
  limit?: number;
  after?: string;
};
type ListWebhookEventAttemptsResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: WebhookEventAttempt[];
};
type ListWebhookEventAttemptsResponse = Response<ListWebhookEventAttemptsResponseSuccess>;
//#endregion
//#region src/webhooks/events/attempts/attempts.d.ts
declare class Attempts {
  private readonly resend;
  constructor(resend: Resend);
  list(options: ListWebhookEventAttemptsOptions, requestOptions?: RequestOptions): Promise<ListWebhookEventAttemptsResponse>;
}
//#endregion
//#region src/webhooks/events/events.d.ts
declare class Events {
  private readonly resend;
  readonly attempts: Attempts;
  constructor(resend: Resend);
  list(options: ListWebhookEventsOptions, requestOptions?: RequestOptions): Promise<ListWebhookEventsResponse>;
  get(options: GetWebhookEventOptions, requestOptions?: RequestOptions): Promise<GetWebhookEventResponse>;
  replay(options: ReplayWebhookEventOptions, requestOptions?: RequestOptions): Promise<ReplayWebhookEventResponse>;
}
//#endregion
//#region src/webhooks/interfaces/create-webhook-options.interface.d.ts
interface CreateWebhookOptions {
  endpoint: string;
  events: WebhookEvent[];
}
interface CreateWebhookRequestOptions extends PostOptions {}
interface CreateWebhookResponseSuccess {
  object: 'webhook';
  id: string;
  signing_secret: string;
}
type CreateWebhookResponse = Response<CreateWebhookResponseSuccess>;
//#endregion
//#region src/webhooks/interfaces/get-webhook.interface.d.ts
interface GetWebhookResponseSuccess {
  object: 'webhook';
  id: string;
  created_at: string;
  status: 'enabled' | 'disabled';
  endpoint: string;
  events: WebhookEvent[] | null;
  signing_secret: string;
}
type GetWebhookResponse = Response<GetWebhookResponseSuccess>;
//#endregion
//#region src/webhooks/interfaces/list-webhooks.interface.d.ts
type ListWebhooksOptions = PaginationOptions;
interface Webhook {
  id: string;
  endpoint: string;
  created_at: string;
  status: 'enabled' | 'disabled';
  events: WebhookEvent[] | null;
}
type ListWebhooksResponseSuccess = {
  object: 'list';
  has_more: boolean;
  data: Webhook[];
};
type ListWebhooksResponse = Response<ListWebhooksResponseSuccess>;
//#endregion
//#region src/webhooks/interfaces/remove-webhook.interface.d.ts
type RemoveWebhookResponseSuccess = Pick<Webhook, 'id'> & {
  object: 'webhook';
  deleted: boolean;
};
type RemoveWebhookResponse = Response<RemoveWebhookResponseSuccess>;
//#endregion
//#region src/webhooks/interfaces/rotate-webhook-signing-secret.interface.d.ts
interface RotateWebhookSigningSecretResponseSuccess {
  object: 'webhook';
  id: string;
  signing_secret: string;
}
type RotateWebhookSigningSecretResponse = Response<RotateWebhookSigningSecretResponseSuccess>;
//#endregion
//#region src/webhooks/interfaces/update-webhook.interface.d.ts
interface UpdateWebhookOptions {
  endpoint?: string;
  events?: WebhookEvent[];
  status?: 'enabled' | 'disabled';
}
interface UpdateWebhookResponseSuccess {
  object: 'webhook';
  id: string;
}
type UpdateWebhookResponse = Response<UpdateWebhookResponseSuccess>;
//#endregion
//#region src/webhooks/webhooks.d.ts
interface Headers {
  id: string;
  timestamp: string;
  signature: string;
}
interface VerifyWebhookOptions {
  payload: string;
  headers: Headers;
  webhookSecret: string;
}
declare class Webhooks {
  private readonly resend;
  readonly events: Events;
  constructor(resend: Resend);
  create(payload: CreateWebhookOptions, requestOptions?: CreateWebhookRequestOptions): Promise<CreateWebhookResponse>;
  get(id: string, requestOptions?: RequestOptions): Promise<GetWebhookResponse>;
  list(options?: ListWebhooksOptions, requestOptions?: RequestOptions): Promise<ListWebhooksResponse>;
  update(id: string, payload: UpdateWebhookOptions, requestOptions?: RequestOptions): Promise<UpdateWebhookResponse>;
  remove(id: string, requestOptions?: RequestOptions): Promise<RemoveWebhookResponse>;
  rotateSigningSecret(id: string, requestOptions?: RequestOptions): Promise<RotateWebhookSigningSecretResponse>;
  verify(payload: VerifyWebhookOptions): WebhookEventPayload;
}
//#endregion
//#region src/resend.d.ts
interface ResendOptions {
  baseUrl?: string;
  userAgent?: string;
}
export declare class Resend {
  readonly key?: string | undefined;
  readonly baseUrl: string;
  readonly userAgent: string;
  private readonly debug;
  private readonly headers;
  readonly segments: Segments;
  readonly apiKeys: ApiKeys;
  /**
   * @deprecated Use segments instead
   */
  readonly audiences: Segments;
  readonly automations: Automations;
  readonly batch: Batch$1;
  readonly broadcasts: Broadcasts;
  readonly contactProperties: ContactProperties;
  readonly contacts: Contacts;
  readonly domains: Domains;
  readonly emails: Emails;
  readonly events: Events$1;
  readonly inboxes: Inboxes;
  readonly logs: Logs;
  readonly oauthGrants: OAuthGrants;
  readonly suppressions: Suppressions;
  readonly templates: Templates;
  readonly topics: Topics;
  readonly usage: Usage;
  readonly webhooks: Webhooks;
  constructor(key?: string | undefined, options?: ResendOptions);
  private logError;
  fetchRequest<T>(path: string, options?: {}): Promise<Response<T>>;
  post<T>(path: string, entity?: unknown, options?: PostOptions & IdempotentRequest): Promise<Response<T>>;
  get<T>(path: string, options?: GetOptions): Promise<Response<T>>;
  put<T>(path: string, entity: unknown, options?: PutOptions): Promise<Response<T>>;
  patch<T>(path: string, entity: unknown, options?: PatchOptions): Promise<Response<T>>;
  delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
}
//#endregion
export type { AddInboxThreadLabelsOptions, AddInboxThreadLabelsResponse, AddInboxThreadLabelsResponseSuccess, ContactCreatedEvent, ContactDeletedEvent, ContactTopicsUpdatedEvent, ContactUpdatedEvent, CreateInboxDraftOptions, CreateInboxDraftRequestOptions, CreateInboxDraftResponse, CreateInboxDraftResponseSuccess, CreateInboxLabelOptions, CreateInboxLabelRequestOptions, CreateInboxLabelResponse, CreateInboxLabelResponseSuccess, CreateInboxOptions, CreateInboxRequestOptions, CreateInboxResponse, CreateInboxResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, DomainCreatedEvent, DomainDeletedEvent, DomainUpdatedEvent, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, ErrorResponse, ForwardInboxThreadEmailOptions, ForwardInboxThreadEmailRequestOptions, ForwardInboxThreadEmailResponse, ForwardInboxThreadEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetInboxAgentOptions, GetInboxAgentResponse, GetInboxAgentResponseSuccess, GetInboxDraftOptions, GetInboxDraftResponse, GetInboxDraftResponseSuccess, GetInboxResponse, GetInboxResponseSuccess, GetInboxThreadEmailOptions, GetInboxThreadEmailResponse, GetInboxThreadEmailResponseSuccess, GetInboxThreadOptions, GetInboxThreadResponse, GetInboxThreadResponseSuccess, GetWebhookEventOptions, GetWebhookEventResponse, GetWebhookEventResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, Inbox, InboxAgentAction, InboxAgentSettings, InboxAgentTone, InboxCreatedEvent, InboxDeletedEvent, InboxDraft, InboxDraftAttachment, InboxDraftAttachmentOptions, InboxDraftCreatedEvent, InboxDraftDeletedEvent, InboxDraftListItem, InboxDraftSentEvent, InboxDraftType, InboxDraftUpdatedEvent, InboxEmailReceivedEvent, InboxEmailSentEvent, InboxLabel, InboxLabelColor, InboxMessage, InboxMessageAttachment, InboxMessageFolder, InboxSelector, InboxThread, InboxThreadAssignedEvent, InboxThreadCreatedEvent, InboxThreadFolderUpdatedEvent, InboxThreadLabel, InboxThreadLabelList, InboxThreadLabelsUpdatedEvent, InboxThreadSearchResult, InboxThreadSummary, InboxThreadUnassignedEvent, InboxUpdatedEvent, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListInboxDraftsOptions, ListInboxDraftsResponse, ListInboxDraftsResponseSuccess, ListInboxLabelsOptions, ListInboxLabelsResponse, ListInboxLabelsResponseSuccess, ListInboxThreadEmailsOptions, ListInboxThreadEmailsResponse, ListInboxThreadEmailsResponseSuccess, ListInboxThreadsOptions, ListInboxThreadsResponse, ListInboxThreadsResponseSuccess, ListInboxesOptions, ListInboxesResponse, ListInboxesResponseSuccess, ListOAuthGrantsOptions, ListOAuthGrantsResponse, ListOAuthGrantsResponseSuccess, ListWebhookEventAttemptsOptions, ListWebhookEventAttemptsResponse, ListWebhookEventAttemptsResponseSuccess, ListWebhookEventsOptions, ListWebhookEventsResponse, ListWebhookEventsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, MoveThreadFolder, OAuthGrant, RemoveInboxDraftOptions, RemoveInboxDraftResponse, RemoveInboxDraftResponseSuccess, RemoveInboxLabelOptions, RemoveInboxLabelResponse, RemoveInboxLabelResponseSuccess, RemoveInboxResponse, RemoveInboxResponseSuccess, RemoveInboxThreadLabelOptions, RemoveInboxThreadLabelResponse, RemoveInboxThreadLabelResponseSuccess, RemoveInboxThreadOptions, RemoveInboxThreadResponse, RemoveInboxThreadResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, ReplayWebhookEventOptions, ReplayWebhookEventResponse, ReplayWebhookEventResponseSuccess, ReplyInboxThreadEmailOptions, ReplyInboxThreadEmailRequestOptions, ReplyInboxThreadEmailResponse, ReplyInboxThreadEmailResponseSuccess, ResendOptions, Response, RevokeOAuthGrantResponse, RevokeOAuthGrantResponseSuccess, RotateWebhookSigningSecretResponse, RotateWebhookSigningSecretResponseSuccess, SearchInboxThreadsOptions, SearchInboxThreadsResponse, SearchInboxThreadsResponseSuccess, SendInboxDraftOptions, SendInboxDraftRequestOptions, SendInboxDraftResponse, SendInboxDraftResponseSuccess, SetInboxThreadLabelsOptions, SetInboxThreadLabelsResponse, SetInboxThreadLabelsResponseSuccess, SuppressionAddedEvent, SuppressionRemovedEvent, TopicCreatedEvent, TopicDeletedEvent, TopicUpdatedEvent, UpdateInboxAgentOptions, UpdateInboxAgentResponse, UpdateInboxAgentResponseSuccess, UpdateInboxDraftOptions, UpdateInboxDraftResponse, UpdateInboxDraftResponseSuccess, UpdateInboxLabelOptions, UpdateInboxLabelResponse, UpdateInboxLabelResponseSuccess, UpdateInboxOptions, UpdateInboxResponse, UpdateInboxResponseSuccess, UpdateInboxThreadOptions, UpdateInboxThreadResponse, UpdateInboxThreadResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, Webhook, WebhookEvent, WebhookEventAttempt, WebhookEventLog, WebhookEventLogStatus, WebhookEventPayload };