/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: acafa6a3e5ce */ import * as z from "zod/v3"; import { RFCDate } from "../../types/rfcdate.js"; import { AdditionalFieldDefinition, AdditionalFieldDefinition$Outbound, AdditionalFieldDefinition$outboundSchema, } from "./additionalfielddefinition.js"; import { DatasourceProfile, DatasourceProfile$Outbound, DatasourceProfile$outboundSchema, } from "./datasourceprofile.js"; import { EmployeeTeamInfo, EmployeeTeamInfo$Outbound, EmployeeTeamInfo$outboundSchema, } from "./employeeteaminfo.js"; import { EntityRelationship, EntityRelationship$Outbound, EntityRelationship$outboundSchema, } from "./entityrelationship.js"; import { SocialNetworkDefinition, SocialNetworkDefinition$Outbound, SocialNetworkDefinition$outboundSchema, } from "./socialnetworkdefinition.js"; import { StructuredLocation, StructuredLocation$Outbound, StructuredLocation$outboundSchema, } from "./structuredlocation.js"; /** * Describes employee info */ export type EmployeeInfoDefinition = { /** * The employee's email */ email: string; /** * The first name of the employee. **Note**: The value cannot be empty * * @remarks */ firstName?: string | undefined; /** * The last name of the employee. **Note**: The value cannot be empty * * @remarks */ lastName?: string | undefined; /** * The preferred name or nickname of the employee */ preferredName?: string | undefined; /** * **[Advanced]** A unique universal internal identifier for the employee. This is solely used for understanding manager relationships along with `managerId`. * * @remarks */ id?: string | undefined; /** * The employee's phone number. */ phoneNumber?: string | undefined; /** * The employee's location (city/office name etc). * * @deprecated field: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Field is deprecated. */ location?: string | undefined; /** * Detailed location with information about country, state, city etc. */ structuredLocation?: StructuredLocation | undefined; /** * The employee's role title. */ title?: string | undefined; /** * The employee's profile pic */ photoUrl?: string | undefined; /** * Typically the highest level organizational unit; generally applies to bigger companies with multiple distinct businesses. */ businessUnit?: string | undefined; /** * An organizational unit where everyone has a similar task, e.g. `Engineering`. */ department: string; /** * The datasource profiles of the employee, e.g. `Slack`,`Github`. */ datasourceProfiles?: Array | undefined; /** * Info about the employee's team(s) */ teams?: Array | undefined; /** * The date when the employee started */ startDate?: RFCDate | undefined; /** * If a former employee, the last date of employment. */ endDate?: RFCDate | undefined; /** * Short biography or mission statement of the employee. */ bio?: string | undefined; /** * She/her, He/his or other pronoun. */ pronoun?: string | undefined; /** * Other names associated with the employee. */ alsoKnownAs?: Array | undefined; /** * Link to internal company person profile. */ profileUrl?: string | undefined; /** * List of social network profiles. */ socialNetworks?: Array | undefined; /** * The email of the employee's manager */ managerEmail?: string | undefined; /** * **[Advanced]** A unique universal internal identifier for the employee's manager. This is solely used in conjunction with `id`. * * @remarks */ managerId?: string | undefined; /** * The type of the employee, an enum of `FULL_TIME`, `CONTRACTOR`, `NON_EMPLOYEE` */ type?: string | undefined; /** * List of unidirectional relationships with other employees. E.g. this employee (`A`) is a CHIEF_OF_STAFF to another employee (`B`); or this employee (`A`) is an EXECUTIVE_ASSISTANT of another employee (`C`). The mapping should be attached to `A`'s profile. */ relationships?: Array | undefined; /** * The status of the employee, an enum of `CURRENT`, `FUTURE`, `EX` */ status?: string | undefined; /** * List of additional fields with more information about the employee. */ additionalFields?: Array | undefined; }; /** @internal */ export type EmployeeInfoDefinition$Outbound = { email: string; firstName?: string | undefined; lastName?: string | undefined; preferredName?: string | undefined; id?: string | undefined; phoneNumber?: string | undefined; location?: string | undefined; structuredLocation?: StructuredLocation$Outbound | undefined; title?: string | undefined; photoUrl?: string | undefined; businessUnit?: string | undefined; department: string; datasourceProfiles?: Array | undefined; teams?: Array | undefined; startDate?: string | undefined; endDate?: string | undefined; bio?: string | undefined; pronoun?: string | undefined; alsoKnownAs?: Array | undefined; profileUrl?: string | undefined; socialNetworks?: Array | undefined; managerEmail?: string | undefined; managerId?: string | undefined; type: string; relationships?: Array | undefined; status: string; additionalFields?: Array | undefined; }; /** @internal */ export const EmployeeInfoDefinition$outboundSchema: z.ZodType< EmployeeInfoDefinition$Outbound, z.ZodTypeDef, EmployeeInfoDefinition > = z.object({ email: z.string(), firstName: z.string().optional(), lastName: z.string().optional(), preferredName: z.string().optional(), id: z.string().optional(), phoneNumber: z.string().optional(), location: z.string().optional(), structuredLocation: StructuredLocation$outboundSchema.optional(), title: z.string().optional(), photoUrl: z.string().optional(), businessUnit: z.string().optional(), department: z.string(), datasourceProfiles: z.array(DatasourceProfile$outboundSchema).optional(), teams: z.array(EmployeeTeamInfo$outboundSchema).optional(), startDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), endDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), bio: z.string().optional(), pronoun: z.string().optional(), alsoKnownAs: z.array(z.string()).optional(), profileUrl: z.string().optional(), socialNetworks: z.array(SocialNetworkDefinition$outboundSchema).optional(), managerEmail: z.string().optional(), managerId: z.string().optional(), type: z.string().default("FULL_TIME"), relationships: z.array(EntityRelationship$outboundSchema).optional(), status: z.string().default("CURRENT"), additionalFields: z.array(AdditionalFieldDefinition$outboundSchema) .optional(), }); export function employeeInfoDefinitionToJSON( employeeInfoDefinition: EmployeeInfoDefinition, ): string { return JSON.stringify( EmployeeInfoDefinition$outboundSchema.parse(employeeInfoDefinition), ); }