/* * 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 SmsMessagesDeleteGlobals = { /** * 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 SmsMessagesDeleteRequest = { /** * 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; }; export type SmsMessagesDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Messages */ deleteMessageResponse?: components.DeleteMessageResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const SmsMessagesDeleteGlobals$inboundSchema: z.ZodType< SmsMessagesDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type SmsMessagesDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const SmsMessagesDeleteGlobals$outboundSchema: z.ZodType< SmsMessagesDeleteGlobals$Outbound, z.ZodTypeDef, SmsMessagesDeleteGlobals > = 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 SmsMessagesDeleteGlobals$ { /** @deprecated use `SmsMessagesDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = SmsMessagesDeleteGlobals$inboundSchema; /** @deprecated use `SmsMessagesDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = SmsMessagesDeleteGlobals$outboundSchema; /** @deprecated use `SmsMessagesDeleteGlobals$Outbound` instead. */ export type Outbound = SmsMessagesDeleteGlobals$Outbound; } export function smsMessagesDeleteGlobalsToJSON( smsMessagesDeleteGlobals: SmsMessagesDeleteGlobals, ): string { return JSON.stringify( SmsMessagesDeleteGlobals$outboundSchema.parse(smsMessagesDeleteGlobals), ); } export function smsMessagesDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SmsMessagesDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SmsMessagesDeleteGlobals' from JSON`, ); } /** @internal */ export const SmsMessagesDeleteRequest$inboundSchema: z.ZodType< SmsMessagesDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type SmsMessagesDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const SmsMessagesDeleteRequest$outboundSchema: z.ZodType< SmsMessagesDeleteRequest$Outbound, z.ZodTypeDef, SmsMessagesDeleteRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SmsMessagesDeleteRequest$ { /** @deprecated use `SmsMessagesDeleteRequest$inboundSchema` instead. */ export const inboundSchema = SmsMessagesDeleteRequest$inboundSchema; /** @deprecated use `SmsMessagesDeleteRequest$outboundSchema` instead. */ export const outboundSchema = SmsMessagesDeleteRequest$outboundSchema; /** @deprecated use `SmsMessagesDeleteRequest$Outbound` instead. */ export type Outbound = SmsMessagesDeleteRequest$Outbound; } export function smsMessagesDeleteRequestToJSON( smsMessagesDeleteRequest: SmsMessagesDeleteRequest, ): string { return JSON.stringify( SmsMessagesDeleteRequest$outboundSchema.parse(smsMessagesDeleteRequest), ); } export function smsMessagesDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SmsMessagesDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SmsMessagesDeleteRequest' from JSON`, ); } /** @internal */ export const SmsMessagesDeleteResponse$inboundSchema: z.ZodType< SmsMessagesDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteMessageResponse: components.DeleteMessageResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteMessageResponse": "deleteMessageResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type SmsMessagesDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteMessageResponse?: components.DeleteMessageResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const SmsMessagesDeleteResponse$outboundSchema: z.ZodType< SmsMessagesDeleteResponse$Outbound, z.ZodTypeDef, SmsMessagesDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteMessageResponse: components.DeleteMessageResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteMessageResponse: "DeleteMessageResponse", 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 SmsMessagesDeleteResponse$ { /** @deprecated use `SmsMessagesDeleteResponse$inboundSchema` instead. */ export const inboundSchema = SmsMessagesDeleteResponse$inboundSchema; /** @deprecated use `SmsMessagesDeleteResponse$outboundSchema` instead. */ export const outboundSchema = SmsMessagesDeleteResponse$outboundSchema; /** @deprecated use `SmsMessagesDeleteResponse$Outbound` instead. */ export type Outbound = SmsMessagesDeleteResponse$Outbound; } export function smsMessagesDeleteResponseToJSON( smsMessagesDeleteResponse: SmsMessagesDeleteResponse, ): string { return JSON.stringify( SmsMessagesDeleteResponse$outboundSchema.parse(smsMessagesDeleteResponse), ); } export function smsMessagesDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SmsMessagesDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SmsMessagesDeleteResponse' from JSON`, ); }