/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { ControlDomain, ControlDomain$outboundSchema, } from "./controldomain.js"; import { FrameworkSection, FrameworkSection$Outbound, FrameworkSection$outboundSchema, } from "./frameworksection.js"; /** * The GDPR role of the control, which specifies whether the data is being "collected" or "processed". See the GdprRole enum for possible values. * * @remarks * This field should only be included for controls that are to be mapped to the GDPR framework. */ export const Role = { Both: "BOTH", Controller: "CONTROLLER", Processor: "PROCESSOR", } as const; /** * The GDPR role of the control, which specifies whether the data is being "collected" or "processed". See the GdprRole enum for possible values. * * @remarks * This field should only be included for controls that are to be mapped to the GDPR framework. */ export type Role = ClosedEnum; export type CreateCustomControlInput = { /** * The external id of the control. */ externalId: string; /** * The name of the control. */ name: string | null; /** * The description of the control. */ description: string; /** * The effective date of the control. */ effectiveDate: Date; category: ControlDomain; /** * Framework sections that the control should be mapped to. */ sections?: Array | null | undefined; /** * The GDPR role of the control, which specifies whether the data is being "collected" or "processed". See the GdprRole enum for possible values. * * @remarks * This field should only be included for controls that are to be mapped to the GDPR framework. */ role?: Role | null | undefined; }; /** @internal */ export const Role$outboundSchema: z.ZodNativeEnum = z.nativeEnum( Role, ); /** @internal */ export type CreateCustomControlInput$Outbound = { externalId: string; name: string | null; description: string; effectiveDate: string; category: string; sections?: Array | null | undefined; role?: string | null | undefined; }; /** @internal */ export const CreateCustomControlInput$outboundSchema: z.ZodType< CreateCustomControlInput$Outbound, z.ZodTypeDef, CreateCustomControlInput > = z.object({ externalId: z.string(), name: z.nullable(z.string()), description: z.string(), effectiveDate: z.date().transform(v => v.toISOString()), category: ControlDomain$outboundSchema, sections: z.nullable(z.array(FrameworkSection$outboundSchema)).optional(), role: z.nullable(Role$outboundSchema).optional(), }); export function createCustomControlInputToJSON( createCustomControlInput: CreateCustomControlInput, ): string { return JSON.stringify( CreateCustomControlInput$outboundSchema.parse(createCustomControlInput), ); }