/**
 * Zendesk Node - Version 1
 * Discriminator: resource=ticket, operation=create
 */


interface Credentials {
  zendeskApi: CredentialReference;
  zendeskOAuth2Api: CredentialReference;
}

/** Tickets are the means through which your end users (customers) communicate with agents in Zendesk Support */
export type ZendeskV1TicketCreateParams = {
  resource: 'ticket';
  operation: 'create';
  authentication?: 'apiToken' | 'oAuth2' | Expression<string>;
/**
 * The first comment on the ticket
 */
    description?: string | Expression<string> | PlaceholderValue;
/**
 * JSON Parameters
 * @default false
 */
    jsonParameters?: boolean | Expression<boolean>;
/**
 * Additional Fields
 * @displayOptions.show { jsonParameters: [false] }
 * @default {}
 */
    additionalFields?: {
    /** Custom Fields
     * @default {}
     */
    customFieldsUi?: {
        /** Custom Field
     */
    customFieldsValues?: Array<{
      /** Custom field ID. Choose from the list, or specify an ID using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;.
       */
      id?: string | Expression<string>;
      /** Custom field Value
       */
      value?: string | Expression<string> | PlaceholderValue;
    }>;
  };
    /** An ID you can use to link Zendesk Support tickets to local records
     */
    externalId?: string | Expression<string> | PlaceholderValue;
    /** The group this ticket is assigned to. Choose from the list, or specify an ID using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;.
     */
    group?: string | Expression<string>;
    /** The original recipient e-mail address of the ticket
     */
    recipient?: string | Expression<string> | PlaceholderValue;
    /** The state of the ticket
     */
    status?: 'closed' | 'new' | 'hold' | 'open' | 'pending' | 'solved' | Expression<string>;
    /** The value of the subject field for this ticket
     */
    subject?: string | Expression<string> | PlaceholderValue;
    /** The array of tags applied to this ticket. 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[];
    /** The type of this ticket
     */
    type?: 'question' | 'incident' | 'problem' | 'task' | Expression<string>;
  };
/**
 * Object of values to set as described &lt;a href="https://developer.zendesk.com/rest_api/docs/support/tickets"&gt;here&lt;/a&gt;
 * @displayOptions.show { jsonParameters: [true] }
 */
    additionalFieldsJson?: IDataObject | string | Expression<string>;
};

export type ZendeskV1TicketCreateOutput = {
  allow_attachments?: boolean;
  allow_channelback?: boolean;
  brand_id?: number;
  collaborator_ids?: Array<number>;
  created_at?: string;
  custom_fields?: Array<{
    id?: number;
  }>;
  custom_status_id?: number;
  description?: string;
  due_at?: null;
  encoded_id?: string;
  fields?: Array<{
    id?: number;
  }>;
  follower_ids?: Array<number>;
  forum_topic_id?: null;
  from_messaging_channel?: boolean;
  generated_timestamp?: number;
  has_incidents?: boolean;
  id?: number;
  is_public?: boolean;
  problem_id?: null;
  requester_id?: number;
  satisfaction_rating?: {
    score?: string;
  };
  status?: string;
  submitter_id?: number;
  tags?: Array<string>;
  ticket_form_id?: number;
  updated_at?: string;
  url?: string;
  via?: {
    channel?: string;
    source?: {
      rel?: null;
    };
  };
};

export type ZendeskV1TicketCreateNode = {
  type: 'n8n-nodes-base.zendesk';
  version: 1;
  credentials?: Credentials;
  config: NodeConfig<ZendeskV1TicketCreateParams>;
  output?: Items<ZendeskV1TicketCreateOutput>;
};