/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SmsMessagesUpdateGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type SmsMessagesUpdateRequest = { /** * ID of the record you are acting upon. */ id: string; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ serviceId?: string | undefined; /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; message: components.MessageInput; }; export type SmsMessagesUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Messages */ updateMessageResponse?: components.UpdateMessageResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const SmsMessagesUpdateGlobals$inboundSchema: z.ZodType< SmsMessagesUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type SmsMessagesUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const SmsMessagesUpdateGlobals$outboundSchema: z.ZodType< SmsMessagesUpdateGlobals$Outbound, z.ZodTypeDef, SmsMessagesUpdateGlobals > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SmsMessagesUpdateGlobals$ { /** @deprecated use `SmsMessagesUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = SmsMessagesUpdateGlobals$inboundSchema; /** @deprecated use `SmsMessagesUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = SmsMessagesUpdateGlobals$outboundSchema; /** @deprecated use `SmsMessagesUpdateGlobals$Outbound` instead. */ export type Outbound = SmsMessagesUpdateGlobals$Outbound; } export function smsMessagesUpdateGlobalsToJSON( smsMessagesUpdateGlobals: SmsMessagesUpdateGlobals, ): string { return JSON.stringify( SmsMessagesUpdateGlobals$outboundSchema.parse(smsMessagesUpdateGlobals), ); } export function smsMessagesUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SmsMessagesUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SmsMessagesUpdateGlobals' from JSON`, ); } /** @internal */ export const SmsMessagesUpdateRequest$inboundSchema: z.ZodType< SmsMessagesUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), Message: components.MessageInput$inboundSchema, }).transform((v) => { return remap$(v, { "Message": "message", }); }); /** @internal */ export type SmsMessagesUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; Message: components.MessageInput$Outbound; }; /** @internal */ export const SmsMessagesUpdateRequest$outboundSchema: z.ZodType< SmsMessagesUpdateRequest$Outbound, z.ZodTypeDef, SmsMessagesUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), message: components.MessageInput$outboundSchema, }).transform((v) => { return remap$(v, { message: "Message", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SmsMessagesUpdateRequest$ { /** @deprecated use `SmsMessagesUpdateRequest$inboundSchema` instead. */ export const inboundSchema = SmsMessagesUpdateRequest$inboundSchema; /** @deprecated use `SmsMessagesUpdateRequest$outboundSchema` instead. */ export const outboundSchema = SmsMessagesUpdateRequest$outboundSchema; /** @deprecated use `SmsMessagesUpdateRequest$Outbound` instead. */ export type Outbound = SmsMessagesUpdateRequest$Outbound; } export function smsMessagesUpdateRequestToJSON( smsMessagesUpdateRequest: SmsMessagesUpdateRequest, ): string { return JSON.stringify( SmsMessagesUpdateRequest$outboundSchema.parse(smsMessagesUpdateRequest), ); } export function smsMessagesUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SmsMessagesUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SmsMessagesUpdateRequest' from JSON`, ); } /** @internal */ export const SmsMessagesUpdateResponse$inboundSchema: z.ZodType< SmsMessagesUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateMessageResponse: components.UpdateMessageResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateMessageResponse": "updateMessageResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type SmsMessagesUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateMessageResponse?: components.UpdateMessageResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const SmsMessagesUpdateResponse$outboundSchema: z.ZodType< SmsMessagesUpdateResponse$Outbound, z.ZodTypeDef, SmsMessagesUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateMessageResponse: components.UpdateMessageResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateMessageResponse: "UpdateMessageResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SmsMessagesUpdateResponse$ { /** @deprecated use `SmsMessagesUpdateResponse$inboundSchema` instead. */ export const inboundSchema = SmsMessagesUpdateResponse$inboundSchema; /** @deprecated use `SmsMessagesUpdateResponse$outboundSchema` instead. */ export const outboundSchema = SmsMessagesUpdateResponse$outboundSchema; /** @deprecated use `SmsMessagesUpdateResponse$Outbound` instead. */ export type Outbound = SmsMessagesUpdateResponse$Outbound; } export function smsMessagesUpdateResponseToJSON( smsMessagesUpdateResponse: SmsMessagesUpdateResponse, ): string { return JSON.stringify( SmsMessagesUpdateResponse$outboundSchema.parse(smsMessagesUpdateResponse), ); } export function smsMessagesUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SmsMessagesUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SmsMessagesUpdateResponse' from JSON`, ); }