/* * 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 { CustomFieldEntryPayloadV1, CustomFieldEntryPayloadV1$inboundSchema, CustomFieldEntryPayloadV1$Outbound, CustomFieldEntryPayloadV1$outboundSchema, } from "./customfieldentrypayloadv1.js"; import { IncidentRoleAssignmentPayloadV1, IncidentRoleAssignmentPayloadV1$inboundSchema, IncidentRoleAssignmentPayloadV1$Outbound, IncidentRoleAssignmentPayloadV1$outboundSchema, } from "./incidentroleassignmentpayloadv1.js"; /** * Whether the incident is real or test */ export const CreateRequestBody10Mode = { Real: "real", Test: "test", } as const; /** * Whether the incident is real or test */ export type CreateRequestBody10Mode = ClosedEnum< typeof CreateRequestBody10Mode >; /** * Current status of the incident */ export const CreateRequestBody10Status = { Triage: "triage", Investigating: "investigating", Fixing: "fixing", Monitoring: "monitoring", Closed: "closed", Declined: "declined", } as const; /** * Current status of the incident */ export type CreateRequestBody10Status = ClosedEnum< typeof CreateRequestBody10Status >; /** * 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 CreateRequestBody10Visibility = { 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 CreateRequestBody10Visibility = ClosedEnum< typeof CreateRequestBody10Visibility >; export type CreateRequestBody10 = { /** * Set the incident's custom fields to these values */ customFieldEntries?: Array | undefined; /** * Unique string used to de-duplicate incident create requests */ idempotencyKey: string; /** * Assign incident roles to these people */ incidentRoleAssignments?: Array | undefined; /** * Incident type to create this incident as */ incidentTypeId?: string | undefined; /** * Whether the incident is real or test */ mode?: CreateRequestBody10Mode | undefined; /** * Explanation of the incident */ name?: string | undefined; /** * Severity to create incident as */ severityId?: 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 | undefined; /** * Channel ID of the source message, if this incident was created from one */ sourceMessageChannelId?: string | undefined; /** * Timestamp of the source message, if this incident was created from one */ sourceMessageTimestamp?: string | undefined; /** * Current status of the incident */ status?: CreateRequestBody10Status | undefined; /** * Detailed description of the incident */ summary?: string | undefined; /** * 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: CreateRequestBody10Visibility; }; /** @internal */ export const CreateRequestBody10Mode$inboundSchema: z.ZodNativeEnum< typeof CreateRequestBody10Mode > = z.nativeEnum(CreateRequestBody10Mode); /** @internal */ export const CreateRequestBody10Mode$outboundSchema: z.ZodNativeEnum< typeof CreateRequestBody10Mode > = CreateRequestBody10Mode$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateRequestBody10Mode$ { /** @deprecated use `CreateRequestBody10Mode$inboundSchema` instead. */ export const inboundSchema = CreateRequestBody10Mode$inboundSchema; /** @deprecated use `CreateRequestBody10Mode$outboundSchema` instead. */ export const outboundSchema = CreateRequestBody10Mode$outboundSchema; } /** @internal */ export const CreateRequestBody10Status$inboundSchema: z.ZodNativeEnum< typeof CreateRequestBody10Status > = z.nativeEnum(CreateRequestBody10Status); /** @internal */ export const CreateRequestBody10Status$outboundSchema: z.ZodNativeEnum< typeof CreateRequestBody10Status > = CreateRequestBody10Status$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateRequestBody10Status$ { /** @deprecated use `CreateRequestBody10Status$inboundSchema` instead. */ export const inboundSchema = CreateRequestBody10Status$inboundSchema; /** @deprecated use `CreateRequestBody10Status$outboundSchema` instead. */ export const outboundSchema = CreateRequestBody10Status$outboundSchema; } /** @internal */ export const CreateRequestBody10Visibility$inboundSchema: z.ZodNativeEnum< typeof CreateRequestBody10Visibility > = z.nativeEnum(CreateRequestBody10Visibility); /** @internal */ export const CreateRequestBody10Visibility$outboundSchema: z.ZodNativeEnum< typeof CreateRequestBody10Visibility > = CreateRequestBody10Visibility$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateRequestBody10Visibility$ { /** @deprecated use `CreateRequestBody10Visibility$inboundSchema` instead. */ export const inboundSchema = CreateRequestBody10Visibility$inboundSchema; /** @deprecated use `CreateRequestBody10Visibility$outboundSchema` instead. */ export const outboundSchema = CreateRequestBody10Visibility$outboundSchema; } /** @internal */ export const CreateRequestBody10$inboundSchema: z.ZodType< CreateRequestBody10, z.ZodTypeDef, unknown > = z.object({ custom_field_entries: z.array(CustomFieldEntryPayloadV1$inboundSchema) .optional(), idempotency_key: z.string(), incident_role_assignments: z.array( IncidentRoleAssignmentPayloadV1$inboundSchema, ).optional(), incident_type_id: z.string().optional(), mode: CreateRequestBody10Mode$inboundSchema.optional(), name: z.string().optional(), severity_id: z.string().optional(), slack_team_id: z.string().optional(), source_message_channel_id: z.string().optional(), source_message_timestamp: z.string().optional(), status: CreateRequestBody10Status$inboundSchema.optional(), summary: z.string().optional(), visibility: CreateRequestBody10Visibility$inboundSchema, }).transform((v) => { return remap$(v, { "custom_field_entries": "customFieldEntries", "idempotency_key": "idempotencyKey", "incident_role_assignments": "incidentRoleAssignments", "incident_type_id": "incidentTypeId", "severity_id": "severityId", "slack_team_id": "slackTeamId", "source_message_channel_id": "sourceMessageChannelId", "source_message_timestamp": "sourceMessageTimestamp", }); }); /** @internal */ export type CreateRequestBody10$Outbound = { custom_field_entries?: Array | undefined; idempotency_key: string; incident_role_assignments?: | Array | undefined; incident_type_id?: string | undefined; mode?: string | undefined; name?: string | undefined; severity_id?: string | undefined; slack_team_id?: string | undefined; source_message_channel_id?: string | undefined; source_message_timestamp?: string | undefined; status?: string | undefined; summary?: string | undefined; visibility: string; }; /** @internal */ export const CreateRequestBody10$outboundSchema: z.ZodType< CreateRequestBody10$Outbound, z.ZodTypeDef, CreateRequestBody10 > = z.object({ customFieldEntries: z.array(CustomFieldEntryPayloadV1$outboundSchema) .optional(), idempotencyKey: z.string(), incidentRoleAssignments: z.array( IncidentRoleAssignmentPayloadV1$outboundSchema, ).optional(), incidentTypeId: z.string().optional(), mode: CreateRequestBody10Mode$outboundSchema.optional(), name: z.string().optional(), severityId: z.string().optional(), slackTeamId: z.string().optional(), sourceMessageChannelId: z.string().optional(), sourceMessageTimestamp: z.string().optional(), status: CreateRequestBody10Status$outboundSchema.optional(), summary: z.string().optional(), visibility: CreateRequestBody10Visibility$outboundSchema, }).transform((v) => { return remap$(v, { customFieldEntries: "custom_field_entries", idempotencyKey: "idempotency_key", incidentRoleAssignments: "incident_role_assignments", incidentTypeId: "incident_type_id", severityId: "severity_id", slackTeamId: "slack_team_id", sourceMessageChannelId: "source_message_channel_id", sourceMessageTimestamp: "source_message_timestamp", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateRequestBody10$ { /** @deprecated use `CreateRequestBody10$inboundSchema` instead. */ export const inboundSchema = CreateRequestBody10$inboundSchema; /** @deprecated use `CreateRequestBody10$outboundSchema` instead. */ export const outboundSchema = CreateRequestBody10$outboundSchema; /** @deprecated use `CreateRequestBody10$Outbound` instead. */ export type Outbound = CreateRequestBody10$Outbound; }