import { RpcMethod } from './commonTypes'; import { Content as pushwoosh_channels_messagingApi_v2_Content } from './pushwoosh_channels_messagingApi_v2'; import { OpenAction as pushwoosh_channels_messagingApi_v2_OpenAction } from './pushwoosh_channels_messagingApi_v2'; export type presetsService_List = RpcMethod; export type presetsService_Get = RpcMethod; export type presetsService_Create = RpcMethod; export type presetsService_Update = RpcMethod; export type presetsService_UpdatePartial = RpcMethod; export type presetsService_Clone = RpcMethod; export type presetsService_Delete = RpcMethod; export type presetsService_ValidateLiquid = RpcMethod; export interface presetsService { /** Lists push notification presets (reusable message templates) for an application, with paging, name/code search and category filter. Use to browse presets or find a preset code before fetching, cloning or editing one. */ List: presetsService_List; /** Returns a single push preset by its preset code, including platforms, localized content, deeplink, rich media and delivery settings. Use after list_push_presets to inspect one preset in full. */ Get: presetsService_Get; /** Creates a new push preset (reusable notification template) in an application from the supplied content and settings. Returns the created preset with its generated code; each call creates a distinct preset. */ Create: presetsService_Create; /** Overwrites an existing push preset (by preset code) with the supplied fields, replacing name, platforms, content and delivery settings. Use for full edits; use update_push_preset_partial to change only selected fields. */ Update: presetsService_Update; /** Updates only the supplied fields of an existing push preset (by preset code), leaving unset fields unchanged. Use for partial edits; use update_push_preset to overwrite the whole preset. */ UpdatePartial: presetsService_UpdatePartial; /** Duplicates an existing push preset (by preset code) into a new preset with the given name in the same application. Each call creates a new copy; the source preset is left unchanged. */ Clone: presetsService_Clone; /** Permanently deletes a push preset by its preset code. Fails if the preset is still used by a running or paused journey; remove it from the journey first. */ Delete: presetsService_Delete; /** Checks the Liquid syntax of one or more template strings using the same engine the publisher uses at send time, returning per-field errors. Pure validation: it does not touch any preset or account data. */ ValidateLiquid: presetsService_ValidateLiquid; } export type ListPresetsRequest_OrderBy = 'NAME' | 'CREATED' | 'UPDATED'; export type ListPresetsRequest_OrderDirection = 'ASC' | 'DESC'; export type ListPresetsRequest = { /** Application code (format XXXXX-XXXXX) whose presets to list. */ application?: string; orderBy?: ListPresetsRequest_OrderBy; orderDirection?: ListPresetsRequest_OrderDirection; page?: number; perPage?: number; /** Case-insensitive substring match on preset name or code (SQL ILIKE %value%). */ searchByName?: string; /** Restrict to presets tagged with any of these category names. */ searchByCategory?: string[]; showHidden?: boolean; /** Deprecated: used only by the legacy send push form. */ isDefault?: boolean; }; export type PlatformProperties = { badge: string; sound: string; soundOff: boolean; priority: string; deliveryPriority: string; iosInterruptionLevel: string; }; export type Preset = { name: string; code: string; platforms: Record; /** Localized properties map */ localizedProperties: Record; /** title map {"en": "content"...} */ localizedTitle: Record; /** subtitle map {"en": "content"...} */ localizedSubtitle: Record; /** content map {"en": "content"...} */ localizedContent: Record; /** deeplink code */ deeplink: string; /** map of params */ deeplinkParams: Record; /** richmedia code */ richmedia: string; /** whether preset is system */ system: boolean; /** url */ url: string; /** inbox image */ inboxImage: string; /** inbox icon */ inboxIcon: string; /** inbox days */ inboxDays: number; /** inbox date */ inboxDate: Date; /** categories */ categories: string[]; created: Date; updated: Date; /** userdata content map {"data": "content"...} */ customData: object; isV2: boolean; /** banner attachment */ banner: string; /** common icon */ icon: string; journeyUuid: string; hidden: boolean; /** open actions for platforms */ openAction: pushwoosh_channels_messagingApi_v2_OpenAction; openActions: Record; platformProperties: Record; /** campaign code the preset belongs to (legacy property "campaignCode") */ campaignCode: string; filterCode: string; geoZones: string; sendRate: number; cappingCount: number; cappingDays: number; notificationSentUrl: string; notificationDeliveredUrl: string; notificationClickUrl: string; remotePage: string; wnsContent: string; originalUrl: string; iosSilent: boolean; androidSilent: boolean; baiduAndroidSilent: boolean; huaweiAndroidSilent: boolean; }; export type ListPresetsResponse = { presets: Preset[]; page: number; perPage: number; total: number; }; export type GetPresetRequest = { /** Preset code of the push preset to fetch. */ code?: string; }; export type GetPresetResponse = { preset: Preset; }; export type CreatePresetRequest = { /** Application code (format XXXXX-XXXXX) the preset belongs to. */ application?: string; /** Human-readable preset name. */ name?: string; /** Channel/send type of the preset (e.g. push, sms, email). */ sendType?: string; platforms?: Record; /** Localized properties map */ localizedProperties?: Record; /** title map {"en": "content"...} */ localizedTitle?: Record; /** subtitle map {"en": "content"...} */ localizedSubtitle?: Record; /** content map {"en": "content"...} */ localizedContent?: Record; /** deeplink code */ deeplink?: string; /** map of params */ deeplinkParams?: Record; /** richmedia code */ richmedia?: string; /** whether preset is system */ system?: boolean; /** url */ url?: string; /** inbox image */ inboxImage?: string; /** inbox icon */ inboxIcon?: string; /** inbox days */ inboxDays?: number; /** inbox date */ inboxDate?: Date; /** user data */ customData?: object; /** categories */ categories?: string[]; /** banner attachment */ banner?: string; /** common icon */ icon?: string; journeyUuid?: string; hidden?: boolean; /** open actions for platforms */ openAction?: pushwoosh_channels_messagingApi_v2_OpenAction; openActions?: Record; platformProperties?: Record; /** campaign code the preset belongs to (legacy property "campaignCode") */ campaignCode?: string; filterCode?: string; geoZones?: string; sendRate?: number; cappingCount?: number; cappingDays?: number; notificationSentUrl?: string; notificationDeliveredUrl?: string; notificationClickUrl?: string; remotePage?: string; wnsContent?: string; originalUrl?: string; iosSilent?: boolean; androidSilent?: boolean; baiduAndroidSilent?: boolean; huaweiAndroidSilent?: boolean; /** when set, pins the preset origin (false = legacy v1); unset keeps the default v2. */ isV2?: boolean; }; export type CreatePresetResponse = { preset: Preset; }; export type UpdatePresetRequest = { /** Preset code of the push preset to overwrite. */ code?: string; /** Human-readable preset name. */ name?: string; /** Channel/send type of the preset (e.g. push, sms, email). */ sendType?: string; platforms?: Record; /** Localized properties map */ localizedProperties?: Record; /** title map {"en": "content"...} */ localizedTitle?: Record; /** subtitle map {"en": "content"...} */ localizedSubtitle?: Record; /** content map {"en": "content"...} */ localizedContent?: Record; /** deeplink code */ deeplink?: string; /** map of params */ deeplinkParams?: Record; /** richmedia code */ richmedia?: string; /** url */ url?: string; /** inbox image */ inboxImage?: string; /** inbox icon */ inboxIcon?: string; /** inbox days */ inboxDays?: number; /** inbox date */ inboxDate?: Date; /** user data */ customData?: object; /** categories */ categories?: string[]; /** banner attachment */ banner?: string; /** common icon */ icon?: string; /** open actions for platforms */ openAction?: pushwoosh_channels_messagingApi_v2_OpenAction; openActions?: Record; platformProperties?: Record; /** campaign code the preset belongs to (legacy property "campaignCode") */ campaignCode?: string; filterCode?: string; geoZones?: string; sendRate?: number; cappingCount?: number; cappingDays?: number; notificationSentUrl?: string; notificationDeliveredUrl?: string; notificationClickUrl?: string; remotePage?: string; wnsContent?: string; originalUrl?: string; iosSilent?: boolean; androidSilent?: boolean; baiduAndroidSilent?: boolean; huaweiAndroidSilent?: boolean; /** when set, pins the preset origin (false = legacy v1); unset keeps the default v2. */ isV2?: boolean; }; export type UpdatePresetPartialRequest = { /** Preset code of the push preset to patch. */ code?: string; /** Human-readable preset name. */ name?: string; /** Channel/send type of the preset (e.g. push, sms, email). */ sendType?: string; platforms?: Record; /** Localized properties map */ localizedProperties?: Record; /** title map {"en": "content"...} */ localizedTitle?: Record; /** subtitle map {"en": "content"...} */ localizedSubtitle?: Record; /** content map {"en": "content"...} */ localizedContent?: Record; /** deeplink code */ deeplink?: string; /** map of params */ deeplinkParams?: Record; /** richmedia code */ richmedia?: string; /** url */ url?: string; /** inbox image */ inboxImage?: string; /** inbox icon */ inboxIcon?: string; /** inbox days */ inboxDays?: number; /** inbox date */ inboxDate?: Date; /** user data */ customData?: object; /** categories */ categories?: string[]; /** banner attachment */ banner?: string; /** common icon */ icon?: string; /** campaign code the preset belongs to (legacy property "campaignCode") */ campaignCode?: string; filterCode?: string; geoZones?: string; sendRate?: number; cappingCount?: number; cappingDays?: number; notificationSentUrl?: string; notificationDeliveredUrl?: string; notificationClickUrl?: string; remotePage?: string; wnsContent?: string; originalUrl?: string; iosSilent?: boolean; androidSilent?: boolean; baiduAndroidSilent?: boolean; huaweiAndroidSilent?: boolean; /** when set, pins the preset origin (false = legacy v1); unset keeps the default v2. */ isV2?: boolean; }; export type UpdatePresetResponse = { preset: Preset; }; export type ClonePresetRequest = { /** Preset code of the source push preset to duplicate. */ code?: string; /** Name for the new cloned preset (required). */ name?: string; }; export type ClonePresetResponse = { preset: Preset; }; export type DeletePresetRequest = { /** Preset code of the push preset to delete. */ code?: string; }; export type DeletePresetResponse = {}; export type ValidateLiquidRequest = { /** * Templates to validate, keyed by a caller-defined field id * (e.g. "title.en", "content.fr") so the client can map errors back to * the corresponding form field. */ templates?: Record; }; export type LiquidValidationError = { /** field id from the request map this error belongs to */ field: string; /** 1-based line number within the template, 0 if the location is unknown */ line: number; /** human readable error message */ message: string; }; export type ValidateLiquidResponse = { /** true when every template is syntactically valid */ valid: boolean; errors: LiquidValidationError[]; };