/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { InformationRequestType, InformationRequestType$outboundSchema, } from "./informationrequesttype.js"; /** * How frequently this request recurs. Null or omitted for one-time requests. */ export const CreateInformationRequestInputCadence = { Annually: "ANNUALLY", Biannually: "BIANNUALLY", Monthly: "MONTHLY", Quarterly: "QUARTERLY", } as const; /** * How frequently this request recurs. Null or omitted for one-time requests. */ export type CreateInformationRequestInputCadence = ClosedEnum< typeof CreateInformationRequestInputCadence >; /** * Input for creating a new information request. * * @remarks * New requests are created in an initial state by default. */ export type CreateInformationRequestInput = { /** * External unique ID to prevent duplicate requests across audit systems. * * @remarks * Must be unique within the audit. Used for idempotency. */ uniqueId: string; /** * Short, descriptive title summarizing what is being requested. * * @remarks * Must be at least 1 character. */ title: string; /** * Type of information request, defining what scope of evidence is needed. * * @remarks * * - POINT_IN_TIME: Evidence for a specific moment (e.g., current state of a policy) * - POPULATION: Evidence covering all items in a category (e.g., all employees) * - SAMPLE: Evidence for a representative sample (e.g., 10 random customer records) */ requestType: InformationRequestType; /** * Detailed description explaining what evidence is needed. * * @remarks * Helps the customer understand what to submit. Optional. */ description?: string | null | undefined; /** * Framework codes this request addresses. * * @remarks * An empty array if no framework codes are associated. */ frameworkCodes: Array; /** * How frequently this request recurs. Null or omitted for one-time requests. */ cadence?: CreateInformationRequestInputCadence | null | undefined; /** * Deadline for fulfilling this request. Null or omitted if no deadline. * * @remarks * Format: ISO 8601 UTC timestamp. */ dueDate?: Date | null | undefined; /** * Start date of the audit period. Evidence before this date may not be accepted. * * @remarks * Null or omitted if not restricted. * Format: ISO 8601 UTC timestamp. */ evidenceCaptureDate?: Date | null | undefined; /** * Control IDs to link directly to this request, beyond those automatically * * @remarks * mapped from framework codes. Each must be the `id` of an existing control in * the customer's organization (the identifier returned by the controls endpoints). * Unknown IDs and controls without an active mapping to a framework in the audit are skipped. * Omit or pass an empty array for no direct control links. */ additionalControlIds?: Array | undefined; }; /** @internal */ export const CreateInformationRequestInputCadence$outboundSchema: z.ZodNativeEnum = z.nativeEnum( CreateInformationRequestInputCadence, ); /** @internal */ export type CreateInformationRequestInput$Outbound = { uniqueId: string; title: string; requestType: string; description?: string | null | undefined; frameworkCodes: Array; cadence?: string | null | undefined; dueDate?: string | null | undefined; evidenceCaptureDate?: string | null | undefined; additionalControlIds?: Array | undefined; }; /** @internal */ export const CreateInformationRequestInput$outboundSchema: z.ZodType< CreateInformationRequestInput$Outbound, z.ZodTypeDef, CreateInformationRequestInput > = z.object({ uniqueId: z.string(), title: z.string(), requestType: InformationRequestType$outboundSchema, description: z.nullable(z.string()).optional(), frameworkCodes: z.array(z.string()), cadence: z.nullable(CreateInformationRequestInputCadence$outboundSchema) .optional(), dueDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), evidenceCaptureDate: z.nullable(z.date().transform(v => v.toISOString())) .optional(), additionalControlIds: z.array(z.string()).optional(), }); export function createInformationRequestInputToJSON( createInformationRequestInput: CreateInformationRequestInput, ): string { return JSON.stringify( CreateInformationRequestInput$outboundSchema.parse( createInformationRequestInput, ), ); }