/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Role detail used for Dow Jones Profile details */ export type RoleDetail = { /** * Dow Jones day persons left the job role */ endDay?: string | undefined; /** * Dow Jones month persons left the job role */ endMonth?: string | undefined; /** * Dow Jones year persons left the job role */ endYear?: string | undefined; /** * Dow Jones occupation category */ occupationCategory?: string | undefined; /** * Dow Jones persons job description */ occupationDescription?: string | undefined; /** * Dow Jones persons job role */ roleType?: string | undefined; /** * Dow Jones day persons started the job role */ startDay?: string | undefined; /** * Dow Jones month persons started the job role */ startMonth?: string | undefined; /** * Dow Jones year persons started the job role */ startYear?: string | undefined; }; /** @internal */ export const RoleDetail$inboundSchema: z.ZodType< RoleDetail, z.ZodTypeDef, unknown > = z.object({ end_day: z.string().optional(), end_month: z.string().optional(), end_year: z.string().optional(), occupation_category: z.string().optional(), occupation_description: z.string().optional(), role_type: z.string().optional(), start_day: z.string().optional(), start_month: z.string().optional(), start_year: z.string().optional(), }).transform((v) => { return remap$(v, { "end_day": "endDay", "end_month": "endMonth", "end_year": "endYear", "occupation_category": "occupationCategory", "occupation_description": "occupationDescription", "role_type": "roleType", "start_day": "startDay", "start_month": "startMonth", "start_year": "startYear", }); }); /** @internal */ export type RoleDetail$Outbound = { end_day?: string | undefined; end_month?: string | undefined; end_year?: string | undefined; occupation_category?: string | undefined; occupation_description?: string | undefined; role_type?: string | undefined; start_day?: string | undefined; start_month?: string | undefined; start_year?: string | undefined; }; /** @internal */ export const RoleDetail$outboundSchema: z.ZodType< RoleDetail$Outbound, z.ZodTypeDef, RoleDetail > = z.object({ endDay: z.string().optional(), endMonth: z.string().optional(), endYear: z.string().optional(), occupationCategory: z.string().optional(), occupationDescription: z.string().optional(), roleType: z.string().optional(), startDay: z.string().optional(), startMonth: z.string().optional(), startYear: z.string().optional(), }).transform((v) => { return remap$(v, { endDay: "end_day", endMonth: "end_month", endYear: "end_year", occupationCategory: "occupation_category", occupationDescription: "occupation_description", roleType: "role_type", startDay: "start_day", startMonth: "start_month", startYear: "start_year", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RoleDetail$ { /** @deprecated use `RoleDetail$inboundSchema` instead. */ export const inboundSchema = RoleDetail$inboundSchema; /** @deprecated use `RoleDetail$outboundSchema` instead. */ export const outboundSchema = RoleDetail$outboundSchema; /** @deprecated use `RoleDetail$Outbound` instead. */ export type Outbound = RoleDetail$Outbound; } export function roleDetailToJSON(roleDetail: RoleDetail): string { return JSON.stringify(RoleDetail$outboundSchema.parse(roleDetail)); } export function roleDetailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RoleDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RoleDetail' from JSON`, ); }