import { RpcMethod } from './commonTypes'; export type FrequencyCappingService_Get = RpcMethod; export type FrequencyCappingService_Update = RpcMethod; export type FrequencyCappingService_Create = RpcMethod; export interface FrequencyCappingService { /** Returns the frequency-capping limits configured for an application code XXXXX-XXXXX, per channel (push, email, SMS, in-app, WhatsApp). Use to read current caps before updating them; errors if no capping has been created for the application. */ Get: FrequencyCappingService_Get; /** Overwrites the per-channel frequency-capping limits of an existing application capping. Use to change caps already created; only the channels present in the request are updated, and it errors if no capping exists yet (use create_frequency_capping first). */ Update: FrequencyCappingService_Update; /** Creates the initial per-channel frequency-capping configuration for an application code XXXXX-XXXXX. Use once to set up capping; use update_frequency_capping to change limits afterwards. */ Create: FrequencyCappingService_Create; } export type Capping = { /** Maximum number of messages allowed within the window (1-1000). */ count: number; /** Length of the rolling window in days (1-30). */ days: number; /** How the counting window is anchored: "" (rolling window, default) or "calendar_day". */ mode: string; /** IANA timezone name midnight is calculated in for calendar_day mode; empty means UTC. */ timezone: string; }; export type FrequencyCapping = { push: Capping; email: Capping; sms: Capping; inApp: Capping; whatsApp: Capping; }; export type GetFrequencyCappingRequest = { /** Application code XXXXX-XXXXX whose capping is read. */ application?: string; }; export type GetFrequencyCappingResponse = { frequencyCapping: FrequencyCapping; }; export type CreateFrequencyCappingRequest = { /** Application code XXXXX-XXXXX to configure capping for. */ application?: string; /** Push channel cap; omit to leave the channel uncapped. */ push?: Capping; /** Email channel cap; omit to leave the channel uncapped. */ email?: Capping; /** SMS channel cap; omit to leave the channel uncapped. */ sms?: Capping; /** In-app channel cap; omit to leave the channel uncapped. */ inApp?: Capping; /** WhatsApp channel cap; omit to leave the channel uncapped. */ whatsApp?: Capping; }; export type CreateFrequencyCappingResponse = { frequencyCapping: FrequencyCapping; }; export type UpdateFrequencyCappingRequest = { /** Application code XXXXX-XXXXX whose capping is updated. */ application?: string; /** Push channel cap; omit to leave that channel unchanged. */ push?: Capping; /** Email channel cap; omit to leave that channel unchanged. */ email?: Capping; /** SMS channel cap; omit to leave that channel unchanged. */ sms?: Capping; /** In-app channel cap; omit to leave that channel unchanged. */ inApp?: Capping; /** WhatsApp channel cap; omit to leave that channel unchanged. */ whatsApp?: Capping; }; export type UpdateFrequencyCappingResponse = {};