/**
 * Help Scout Node - Version 1
 * Discriminator: resource=conversation, operation=create
 */


interface Credentials {
  helpScoutOAuth2Api: CredentialReference;
}

/** Create a new conversation */
export type HelpScoutV1ConversationCreateParams = {
  resource: 'conversation';
  operation: 'create';
/**
 * ID of a mailbox where the conversation is being created. Choose from the list, or specify an ID using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;.
 */
    mailboxId?: string | Expression<string>;
/**
 * Conversation status
 */
    status?: 'active' | 'closed' | 'pending' | Expression<string>;
/**
 * Conversation’s subject
 */
    subject?: string | Expression<string> | PlaceholderValue;
/**
 * Conversation type
 */
    type?: 'chat' | 'email' | 'phone' | Expression<string>;
/**
 * By default the response only contain the ID to resource. If this option gets activated, it will resolve the data automatically.
 * @default true
 */
    resolveData?: boolean | Expression<boolean>;
/**
 * Additional Fields
 * @default {}
 */
    additionalFields?: {
    /** The Help Scout user assigned to the conversation
     * @default 0
     */
    assignTo?: number | Expression<number>;
    /** Whether set to true, an auto reply will be sent as long as there is at least one customer thread in the conversation
     * @default false
     */
    autoReply?: boolean | Expression<boolean>;
    /** When the conversation was closed, only applicable for imported conversations
     */
    closedAt?: string | Expression<string>;
    /** When this conversation was created - ISO 8601 date time
     */
    createdAt?: string | Expression<string>;
    /** Customer Email
     */
    customerEmail?: string | Expression<string> | PlaceholderValue;
    /** Customer ID
     * @default 0
     */
    customerId?: number | Expression<number>;
    /** Whether set to true, no outgoing emails or notifications will be generated
     * @default false
     */
    imported?: boolean | Expression<boolean>;
    /** List of tags to be added to the conversation. Choose from the list, or specify IDs using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;.
     * @default []
     */
    tags?: string[];
    /** ID of the user who is adding the conversation and threads
     * @default 0
     */
    user?: number | Expression<number>;
  };
/**
 * Threads
 * @default {}
 */
    threadsUi?: {
        /** Thread
     */
    threadsValues?: Array<{
      /** Type
       */
      type?: 'chat' | 'customer' | 'note' | 'phone' | 'reply' | Expression<string>;
      /** The message text
       */
      text?: string | Expression<string> | PlaceholderValue;
      /** Email addresses
       * @displayOptions.show { type: ["customer"] }
       * @default []
       */
      bcc?: string | Expression<string> | PlaceholderValue;
      /** Email addresses
       * @displayOptions.show { type: ["customer"] }
       * @default []
       */
      cc?: string | Expression<string> | PlaceholderValue;
      /** Whether true, a draft reply is created
       * @displayOptions.show { type: ["reply"] }
       * @default false
       */
      draft?: boolean | Expression<boolean>;
    }>;
  };
};

export type HelpScoutV1ConversationCreateOutput = {
  _links?: {
    closedBy?: {
      href?: string;
    };
    createdByUser?: {
      href?: string;
    };
    mailbox?: {
      href?: string;
    };
    primaryCustomer?: {
      href?: string;
    };
    self?: {
      href?: string;
    };
    threads?: {
      href?: string;
    };
    web?: {
      href?: string;
    };
  };
  closedBy?: number;
  closedByUser?: {
    email?: string;
    first?: string;
    id?: number;
    last?: string;
    type?: string;
  };
  createdAt?: string;
  createdBy?: {
    email?: string;
    first?: string;
    id?: number;
    last?: string;
    photoUrl?: string;
    type?: string;
  };
  customerWaitingSince?: {
    friendly?: string;
    time?: string;
  };
  folderId?: number;
  mailboxId?: number;
  number?: number;
  primaryCustomer?: {
    email?: string;
    first?: string;
    id?: number;
    last?: string;
    photoUrl?: string;
    type?: string;
  };
  source?: {
    type?: string;
    via?: string;
  };
  state?: string;
  status?: string;
  subject?: string;
  tags?: Array<{
    color?: string;
    id?: number;
    tag?: string;
  }>;
  threads?: number;
  type?: string;
  userUpdatedAt?: string;
};

export type HelpScoutV1ConversationCreateNode = {
  type: 'n8n-nodes-base.helpScout';
  version: 1;
  credentials?: Credentials;
  config: NodeConfig<HelpScoutV1ConversationCreateParams>;
  output?: Items<HelpScoutV1ConversationCreateOutput>;
};