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


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

/** Tickets are the means through which your end users (customers) communicate with agents in Zendesk Support */
export type ZendeskV1TicketUpdateParams = {
  resource: 'ticket';
  operation: 'update';
  authentication?: 'apiToken' | 'oAuth2' | Expression<string>;
/**
 * Ticket ID
 */
    id?: string | Expression<string> | PlaceholderValue;
/**
 * JSON Parameters
 * @default false
 */
    jsonParameters?: boolean | Expression<boolean>;
/**
 * Update Fields
 * @displayOptions.show { jsonParameters: [false] }
 * @default {}
 */
    updateFields?: {
    /** The e-mail address of the assignee
     */
    assigneeEmail?: string | Expression<string> | PlaceholderValue;
    /** 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>;
    /** Internal Ticket Note (Accepts HTML)
     */
    internalNote?: string | Expression<string> | PlaceholderValue;
    /** Public ticket reply
     */
    publicReply?: string | Expression<string> | PlaceholderValue;
    /** 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 update as described &lt;a href="https://developer.zendesk.com/rest_api/docs/support/tickets"&gt;here&lt;/a&gt;
 * @displayOptions.show { jsonParameters: [true] }
 */
    updateFieldsJson?: IDataObject | string | Expression<string>;
};

export type ZendeskV1TicketUpdateOutput = {
  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;
  email_cc_ids?: Array<number>;
  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;
  };
};

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