import * as z from "zod"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Currency } from "./currency.js"; import { CustomMappings, CustomMappings$Outbound } from "./custommappings.js"; import { PassThroughBody, PassThroughBody$Outbound } from "./passthroughbody.js"; /** * Set to sms for SMS messages and mms for MMS messages. */ export declare const MessageType: { readonly Sms: "sms"; readonly Mms: "mms"; }; /** * Set to sms for SMS messages and mms for MMS messages. */ export type MessageType = ClosedEnum; /** * The direction of the message. */ export declare const Direction: { readonly Inbound: "inbound"; readonly OutboundApi: "outbound-api"; readonly OutboundCall: "outbound-call"; readonly OutboundReply: "outbound-reply"; readonly Unknown: "unknown"; }; /** * The direction of the message. */ export type Direction = ClosedEnum; /** * Status of the delivery of the message. */ export declare const MessageStatus: { readonly Accepted: "accepted"; readonly Scheduled: "scheduled"; readonly Canceled: "canceled"; readonly Queued: "queued"; readonly Sending: "sending"; readonly Sent: "sent"; readonly Failed: "failed"; readonly Delivered: "delivered"; readonly Undelivered: "undelivered"; readonly Receiving: "receiving"; readonly Received: "received"; readonly Read: "read"; }; /** * Status of the delivery of the message. */ export type MessageStatus = ClosedEnum; /** * Price of the message. */ export type Price = { perUnit?: string | undefined; totalAmount?: string | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; }; /** * The error returned if your message status is failed or undelivered. */ export type ErrorT = { /** * The error_code provides more information about the failure. If the message was successful, this value is null */ code?: string | undefined; message?: string | undefined; }; export type Message = { /** * A unique identifier for an object. */ id?: string | undefined; /** * The phone number that initiated the message. */ from: string; /** * The phone number that received the message. */ to: string; subject?: string | undefined; /** * The message text. */ body: string; /** * Set to sms for SMS messages and mms for MMS messages. */ type?: MessageType | undefined; /** * The number of units that make up the complete message. Messages can be split up due to the constraints of the message size. */ numberOfUnits?: number | undefined; /** * The number of media files associated with the message. */ numberOfMediaFiles?: number | undefined; /** * The direction of the message. */ direction?: Direction | undefined; /** * Status of the delivery of the message. */ status?: MessageStatus | undefined; /** * The scheduled date and time of the message. */ scheduledAt?: Date | undefined; /** * The date and time that the message was sent */ sentAt?: Date | undefined; /** * Define a webhook to receive delivery notifications. */ webhookUrl?: string | undefined; /** * A client reference. */ reference?: string | undefined; /** * Price of the message. */ price?: Price | undefined; /** * The error returned if your message status is failed or undelivered. */ error?: ErrorT | undefined; /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ messagingServiceId?: string | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: CustomMappings | null | undefined; /** * The user who last updated the object. */ updatedBy?: string | null | undefined; /** * The user who created the object. */ createdBy?: string | null | undefined; /** * The date and time when the object was last updated. */ updatedAt?: Date | null | undefined; /** * The date and time when the object was created. */ createdAt?: Date | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; export type MessageInput = { /** * The phone number that initiated the message. */ from: string; /** * The phone number that received the message. */ to: string; subject?: string | undefined; /** * The message text. */ body: string; /** * Set to sms for SMS messages and mms for MMS messages. */ type?: MessageType | undefined; /** * The scheduled date and time of the message. */ scheduledAt?: Date | undefined; /** * Define a webhook to receive delivery notifications. */ webhookUrl?: string | undefined; /** * A client reference. */ reference?: string | undefined; /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ messagingServiceId?: string | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export declare const MessageType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const MessageType$outboundSchema: z.ZodNativeEnum; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace MessageType$ { /** @deprecated use `MessageType$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly Sms: "sms"; readonly Mms: "mms"; }>; /** @deprecated use `MessageType$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly Sms: "sms"; readonly Mms: "mms"; }>; } /** @internal */ export declare const Direction$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Direction$outboundSchema: z.ZodNativeEnum; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace Direction$ { /** @deprecated use `Direction$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly Inbound: "inbound"; readonly OutboundApi: "outbound-api"; readonly OutboundCall: "outbound-call"; readonly OutboundReply: "outbound-reply"; readonly Unknown: "unknown"; }>; /** @deprecated use `Direction$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly Inbound: "inbound"; readonly OutboundApi: "outbound-api"; readonly OutboundCall: "outbound-call"; readonly OutboundReply: "outbound-reply"; readonly Unknown: "unknown"; }>; } /** @internal */ export declare const MessageStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const MessageStatus$outboundSchema: z.ZodNativeEnum; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace MessageStatus$ { /** @deprecated use `MessageStatus$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly Accepted: "accepted"; readonly Scheduled: "scheduled"; readonly Canceled: "canceled"; readonly Queued: "queued"; readonly Sending: "sending"; readonly Sent: "sent"; readonly Failed: "failed"; readonly Delivered: "delivered"; readonly Undelivered: "undelivered"; readonly Receiving: "receiving"; readonly Received: "received"; readonly Read: "read"; }>; /** @deprecated use `MessageStatus$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly Accepted: "accepted"; readonly Scheduled: "scheduled"; readonly Canceled: "canceled"; readonly Queued: "queued"; readonly Sending: "sending"; readonly Sent: "sent"; readonly Failed: "failed"; readonly Delivered: "delivered"; readonly Undelivered: "undelivered"; readonly Receiving: "receiving"; readonly Received: "received"; readonly Read: "read"; }>; } /** @internal */ export declare const Price$inboundSchema: z.ZodType; /** @internal */ export type Price$Outbound = { per_unit?: string | undefined; total_amount?: string | undefined; currency?: string | null | undefined; }; /** @internal */ export declare const Price$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace Price$ { /** @deprecated use `Price$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `Price$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `Price$Outbound` instead. */ type Outbound = Price$Outbound; } export declare function priceToJSON(price: Price): string; export declare function priceFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const ErrorT$inboundSchema: z.ZodType; /** @internal */ export type ErrorT$Outbound = { code?: string | undefined; message?: string | undefined; }; /** @internal */ export declare const ErrorT$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace ErrorT$ { /** @deprecated use `ErrorT$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `ErrorT$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `ErrorT$Outbound` instead. */ type Outbound = ErrorT$Outbound; } export declare function errorTToJSON(errorT: ErrorT): string; export declare function errorTFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Message$inboundSchema: z.ZodType; /** @internal */ export type Message$Outbound = { id?: string | undefined; from: string; to: string; subject?: string | undefined; body: string; type?: string | undefined; number_of_units?: number | undefined; number_of_media_files?: number | undefined; direction?: string | undefined; status?: string | undefined; scheduled_at?: string | undefined; sent_at?: string | undefined; webhook_url?: string | undefined; reference?: string | undefined; price?: Price$Outbound | undefined; error?: ErrorT$Outbound | undefined; messaging_service_id?: string | undefined; custom_mappings?: CustomMappings$Outbound | null | undefined; updated_by?: string | null | undefined; created_by?: string | null | undefined; updated_at?: string | null | undefined; created_at?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export declare const Message$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace Message$ { /** @deprecated use `Message$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `Message$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `Message$Outbound` instead. */ type Outbound = Message$Outbound; } export declare function messageToJSON(message: Message): string; export declare function messageFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const MessageInput$inboundSchema: z.ZodType; /** @internal */ export type MessageInput$Outbound = { from: string; to: string; subject?: string | undefined; body: string; type?: string | undefined; scheduled_at?: string | undefined; webhook_url?: string | undefined; reference?: string | undefined; messaging_service_id?: string | undefined; pass_through?: Array | undefined; }; /** @internal */ export declare const MessageInput$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace MessageInput$ { /** @deprecated use `MessageInput$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `MessageInput$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `MessageInput$Outbound` instead. */ type Outbound = MessageInput$Outbound; } export declare function messageInputToJSON(messageInput: MessageInput): string; export declare function messageInputFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=message.d.ts.map