/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { AlertEntityType, AlertEntityType$inboundSchema, } from "./alert-entity-type.js"; import { AlertSettings, AlertSettings$inboundSchema, } from "./alert-settings.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; export type AlertSettingsResponse = { config?: AlertSettings | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; enabled?: boolean | undefined; entityId?: string | undefined; entityType?: AlertEntityType | undefined; environmentId?: string | undefined; id?: string | undefined; parentEntityId?: string | undefined; parentEntityType?: string | undefined; status?: Status | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const AlertSettingsResponse$inboundSchema: z.ZodMiniType< AlertSettingsResponse, unknown > = z.pipe( z.object({ config: types.optional(AlertSettings$inboundSchema), created_at: types.optional(types.date()), created_by: types.optional(types.string()), enabled: types.optional(types.boolean()), entity_id: types.optional(types.string()), entity_type: types.optional(AlertEntityType$inboundSchema), environment_id: types.optional(types.string()), id: types.optional(types.string()), parent_entity_id: types.optional(types.string()), parent_entity_type: types.optional(types.string()), status: types.optional(Status$inboundSchema), tenant_id: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "created_by": "createdBy", "entity_id": "entityId", "entity_type": "entityType", "environment_id": "environmentId", "parent_entity_id": "parentEntityId", "parent_entity_type": "parentEntityType", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function alertSettingsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AlertSettingsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AlertSettingsResponse' from JSON`, ); }