/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; import { ActorV2, ActorV2$inboundSchema, ActorV2$Outbound, ActorV2$outboundSchema, } from "./actorv2.js"; import { CustomFieldEntryV1, CustomFieldEntryV1$inboundSchema, CustomFieldEntryV1$Outbound, CustomFieldEntryV1$outboundSchema, } from "./customfieldentryv1.js"; import { IncidentRoleAssignmentV1, IncidentRoleAssignmentV1$inboundSchema, IncidentRoleAssignmentV1$Outbound, IncidentRoleAssignmentV1$outboundSchema, } from "./incidentroleassignmentv1.js"; import { IncidentTimestampV1, IncidentTimestampV1$inboundSchema, IncidentTimestampV1$Outbound, IncidentTimestampV1$outboundSchema, } from "./incidenttimestampv1.js"; import { IncidentTypeV1, IncidentTypeV1$inboundSchema, IncidentTypeV1$Outbound, IncidentTypeV1$outboundSchema, } from "./incidenttypev1.js"; import { SeverityV2, SeverityV2$inboundSchema, SeverityV2$Outbound, SeverityV2$outboundSchema, } from "./severityv2.js"; /** * Whether the incident is real, a test, a tutorial, or importing as a retrospective incident */ export const Mode = { Real: "real", Test: "test", Tutorial: "tutorial", } as const; /** * Whether the incident is real, a test, a tutorial, or importing as a retrospective incident */ export type Mode = ClosedEnum; /** * Current status of the incident */ export const IncidentV1Status = { Triage: "triage", Investigating: "investigating", Fixing: "fixing", Monitoring: "monitoring", Closed: "closed", Declined: "declined", } as const; /** * Current status of the incident */ export type IncidentV1Status = ClosedEnum; /** * Whether the incident should be open to anyone in your Slack workspace (public), or invite-only (private). For more information on Private Incidents see our [help centre](https://help.incident.io/en/articles/5947963-can-we-mark-incidents-as-sensitive-and-restrict-access). */ export const Visibility = { Public: "public", Private: "private", } as const; /** * Whether the incident should be open to anyone in your Slack workspace (public), or invite-only (private). For more information on Private Incidents see our [help centre](https://help.incident.io/en/articles/5947963-can-we-mark-incidents-as-sensitive-and-restrict-access). */ export type Visibility = ClosedEnum; export type IncidentV1 = { /** * The call URL attached to this incident */ callUrl?: string | undefined; /** * When the incident was created */ createdAt: Date; creator: ActorV2; /** * Custom field entries for this incident */ customFieldEntries: Array; /** * Unique identifier for the incident */ id: string; /** * A list of who is assigned to each role for this incident */ incidentRoleAssignments: Array; incidentType?: IncidentTypeV1 | undefined; /** * Whether the incident is real, a test, a tutorial, or importing as a retrospective incident */ mode: Mode; /** * Explanation of the incident */ name: string; /** * A permanent link to the homepage for this incident */ permalink?: string | undefined; /** * Description of the incident */ postmortemDocumentUrl?: string | undefined; /** * Reference to this incident, as displayed across the product */ reference: string; severity?: SeverityV2 | undefined; /** * ID of the Slack channel in the organisation Slack workspace. Note that the channel is sometimes created asynchronously, so may not be present when the incident is just created. */ slackChannelId: string; /** * Name of the slack channel */ slackChannelName?: string | undefined; /** * ID of the Slack team / workspace. This is only required if you are using a Slack Enterprise Grid with multiple teams. */ slackTeamId: string; /** * Current status of the incident */ status: IncidentV1Status; /** * Detailed description of the incident */ summary?: string | undefined; /** * Incident lifecycle events and when they last occurred */ timestamps?: Array | undefined; /** * When the incident was last updated */ updatedAt: Date; /** * Whether the incident should be open to anyone in your Slack workspace (public), or invite-only (private). For more information on Private Incidents see our [help centre](https://help.incident.io/en/articles/5947963-can-we-mark-incidents-as-sensitive-and-restrict-access). */ visibility: Visibility; }; /** @internal */ export const Mode$inboundSchema: z.ZodNativeEnum = z.nativeEnum( Mode, ); /** @internal */ export const Mode$outboundSchema: z.ZodNativeEnum = Mode$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Mode$ { /** @deprecated use `Mode$inboundSchema` instead. */ export const inboundSchema = Mode$inboundSchema; /** @deprecated use `Mode$outboundSchema` instead. */ export const outboundSchema = Mode$outboundSchema; } /** @internal */ export const IncidentV1Status$inboundSchema: z.ZodNativeEnum< typeof IncidentV1Status > = z.nativeEnum(IncidentV1Status); /** @internal */ export const IncidentV1Status$outboundSchema: z.ZodNativeEnum< typeof IncidentV1Status > = IncidentV1Status$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IncidentV1Status$ { /** @deprecated use `IncidentV1Status$inboundSchema` instead. */ export const inboundSchema = IncidentV1Status$inboundSchema; /** @deprecated use `IncidentV1Status$outboundSchema` instead. */ export const outboundSchema = IncidentV1Status$outboundSchema; } /** @internal */ export const Visibility$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Visibility); /** @internal */ export const Visibility$outboundSchema: z.ZodNativeEnum = Visibility$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Visibility$ { /** @deprecated use `Visibility$inboundSchema` instead. */ export const inboundSchema = Visibility$inboundSchema; /** @deprecated use `Visibility$outboundSchema` instead. */ export const outboundSchema = Visibility$outboundSchema; } /** @internal */ export const IncidentV1$inboundSchema: z.ZodType< IncidentV1, z.ZodTypeDef, unknown > = z.object({ call_url: z.string().optional(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), creator: ActorV2$inboundSchema, custom_field_entries: z.array(CustomFieldEntryV1$inboundSchema), id: z.string(), incident_role_assignments: z.array(IncidentRoleAssignmentV1$inboundSchema), incident_type: IncidentTypeV1$inboundSchema.optional(), mode: Mode$inboundSchema, name: z.string(), permalink: z.string().optional(), postmortem_document_url: z.string().optional(), reference: z.string(), severity: SeverityV2$inboundSchema.optional(), slack_channel_id: z.string(), slack_channel_name: z.string().optional(), slack_team_id: z.string(), status: IncidentV1Status$inboundSchema, summary: z.string().optional(), timestamps: z.array(IncidentTimestampV1$inboundSchema).optional(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), visibility: Visibility$inboundSchema, }).transform((v) => { return remap$(v, { "call_url": "callUrl", "created_at": "createdAt", "custom_field_entries": "customFieldEntries", "incident_role_assignments": "incidentRoleAssignments", "incident_type": "incidentType", "postmortem_document_url": "postmortemDocumentUrl", "slack_channel_id": "slackChannelId", "slack_channel_name": "slackChannelName", "slack_team_id": "slackTeamId", "updated_at": "updatedAt", }); }); /** @internal */ export type IncidentV1$Outbound = { call_url?: string | undefined; created_at: string; creator: ActorV2$Outbound; custom_field_entries: Array; id: string; incident_role_assignments: Array; incident_type?: IncidentTypeV1$Outbound | undefined; mode: string; name: string; permalink?: string | undefined; postmortem_document_url?: string | undefined; reference: string; severity?: SeverityV2$Outbound | undefined; slack_channel_id: string; slack_channel_name?: string | undefined; slack_team_id: string; status: string; summary?: string | undefined; timestamps?: Array | undefined; updated_at: string; visibility: string; }; /** @internal */ export const IncidentV1$outboundSchema: z.ZodType< IncidentV1$Outbound, z.ZodTypeDef, IncidentV1 > = z.object({ callUrl: z.string().optional(), createdAt: z.date().transform(v => v.toISOString()), creator: ActorV2$outboundSchema, customFieldEntries: z.array(CustomFieldEntryV1$outboundSchema), id: z.string(), incidentRoleAssignments: z.array(IncidentRoleAssignmentV1$outboundSchema), incidentType: IncidentTypeV1$outboundSchema.optional(), mode: Mode$outboundSchema, name: z.string(), permalink: z.string().optional(), postmortemDocumentUrl: z.string().optional(), reference: z.string(), severity: SeverityV2$outboundSchema.optional(), slackChannelId: z.string(), slackChannelName: z.string().optional(), slackTeamId: z.string(), status: IncidentV1Status$outboundSchema, summary: z.string().optional(), timestamps: z.array(IncidentTimestampV1$outboundSchema).optional(), updatedAt: z.date().transform(v => v.toISOString()), visibility: Visibility$outboundSchema, }).transform((v) => { return remap$(v, { callUrl: "call_url", createdAt: "created_at", customFieldEntries: "custom_field_entries", incidentRoleAssignments: "incident_role_assignments", incidentType: "incident_type", postmortemDocumentUrl: "postmortem_document_url", slackChannelId: "slack_channel_id", slackChannelName: "slack_channel_name", slackTeamId: "slack_team_id", updatedAt: "updated_at", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IncidentV1$ { /** @deprecated use `IncidentV1$inboundSchema` instead. */ export const inboundSchema = IncidentV1$inboundSchema; /** @deprecated use `IncidentV1$outboundSchema` instead. */ export const outboundSchema = IncidentV1$outboundSchema; /** @deprecated use `IncidentV1$Outbound` instead. */ export type Outbound = IncidentV1$Outbound; }