/* * 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 { SDKValidationError } from "./sdk-validation-error.js"; export type UsageRecordSyncEntry = { /** * AgreementID is the subscription's identifier on this marketplace: license_arn on AWS, * * @remarks * usage_reporting_id on GCP, resource_id on Azure. It records which agreement the usage was * billed against, which stays meaningful after the connection that reported it is replaced. */ agreementId?: string | undefined; /** * ConnectionID is the connection that reported this entry, kept for tracing which credentials * * @remarks * were used. It is deliberately not part of the map key: a replaced connection must not make an * already reported record look unreported. */ connectionId?: string | undefined; reportingId?: string | undefined; skipReason?: string | undefined; skipped?: boolean | undefined; /** * SyncedAt is when the marketplace accepted the record. Zero on a skip, since nothing was sent. */ syncedAt?: Date | undefined; }; /** @internal */ export const UsageRecordSyncEntry$inboundSchema: z.ZodMiniType< UsageRecordSyncEntry, unknown > = z.pipe( z.object({ agreement_id: types.optional(types.string()), connection_id: types.optional(types.string()), reporting_id: types.optional(types.string()), skip_reason: types.optional(types.string()), skipped: types.optional(types.boolean()), synced_at: types.optional(types.date()), }), z.transform((v) => { return remap$(v, { "agreement_id": "agreementId", "connection_id": "connectionId", "reporting_id": "reportingId", "skip_reason": "skipReason", "synced_at": "syncedAt", }); }), ); export function usageRecordSyncEntryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UsageRecordSyncEntry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UsageRecordSyncEntry' from JSON`, ); }