// This file was auto-generated by Fern from our API Definition.

/**
 * Contains complete status of all SLA targets when a breach occurs for conversation part type <code>conversation_sla_target_missed</code>.
 */
export interface ConversationSlaTargetMissed {
    /** Name of the SLA */
    sla_name?: string;
    /** Which specific target was missed */
    sla_target_type?: ConversationSlaTargetMissed.SlaTargetType;
    /** Overall SLA status */
    current_sla_status?: ConversationSlaTargetMissed.CurrentSlaStatus;
    /** Status of all SLA targets at the time of breach */
    sla_states?: Record<string, ConversationSlaTargetMissed.SlaStates.Value>;
}

export namespace ConversationSlaTargetMissed {
    /** Which specific target was missed */
    export const SlaTargetType = {
        FirstReplyTime: "first_reply_time",
        NextReplyTime: "next_reply_time",
        ResolutionTime: "resolution_time",
        TimeToClose: "time_to_close",
    } as const;
    export type SlaTargetType = (typeof SlaTargetType)[keyof typeof SlaTargetType];
    /** Overall SLA status */
    export const CurrentSlaStatus = {
        Hit: "hit",
        Missed: "missed",
        Active: "active",
        Paused: "paused",
        Canceled: "canceled",
    } as const;
    export type CurrentSlaStatus = (typeof CurrentSlaStatus)[keyof typeof CurrentSlaStatus];

    export namespace SlaStates {
        export interface Value {
            /** Status of this specific target */
            status?: Value.Status;
            /** Time remaining for active/paused targets (null for hit/missed) */
            seconds_remaining?: number;
        }

        export namespace Value {
            /** Status of this specific target */
            export const Status = {
                Hit: "hit",
                Missed: "missed",
                Active: "active",
                Paused: "paused",
            } as const;
            export type Status = (typeof Status)[keyof typeof Status];
        }
    }
}
