/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { AlertEntityType, AlertEntityType$outboundSchema, } from "./alert-entity-type.js"; import { AlertSettings, AlertSettings$Outbound, AlertSettings$outboundSchema, } from "./alert-settings.js"; export type CreateAlertSettingsRequest = { config: AlertSettings; /** * entity_id is the id of the monitored entity: subscription id, subscription_line_item id, or * * @remarks * group id, matching entity_type. */ entityId: string; entityType: AlertEntityType; /** * parent_entity_id is the subscription id that owns a line-item or group alert. Required when * * @remarks * entity_type is "subscription_line_item" or "group"; omitted for subscription-level alerts. */ parentEntityId?: string | undefined; parentEntityType?: AlertEntityType | undefined; }; /** @internal */ export type CreateAlertSettingsRequest$Outbound = { config: AlertSettings$Outbound; entity_id: string; entity_type: string; parent_entity_id?: string | undefined; parent_entity_type?: string | undefined; }; /** @internal */ export const CreateAlertSettingsRequest$outboundSchema: z.ZodMiniType< CreateAlertSettingsRequest$Outbound, CreateAlertSettingsRequest > = z.pipe( z.object({ config: AlertSettings$outboundSchema, entityId: z.string(), entityType: AlertEntityType$outboundSchema, parentEntityId: z.optional(z.string()), parentEntityType: z.optional(AlertEntityType$outboundSchema), }), z.transform((v) => { return remap$(v, { entityId: "entity_id", entityType: "entity_type", parentEntityId: "parent_entity_id", parentEntityType: "parent_entity_type", }); }), ); export function createAlertSettingsRequestToJSON( createAlertSettingsRequest: CreateAlertSettingsRequest, ): string { return JSON.stringify( CreateAlertSettingsRequest$outboundSchema.parse(createAlertSettingsRequest), ); }