import { RpcMethod, Duration } from './commonTypes'; export type GeozonesService_Create = RpcMethod; export type GeozonesService_Get = RpcMethod; export type GeozonesService_Update = RpcMethod; export type GeozonesService_List = RpcMethod; export type GeozonesService_Delete = RpcMethod; export interface GeozonesService { /** Creates a geozone (a location trigger with center lat/lng, radius and re-entry cooldown) for an application, sending a push preset or inline content when a device enters it. Requires either preset or content; edit it later with update_geozone. */ Create: GeozonesService_Create; /** Returns a single geozone by its geozone code, including coordinates, range, cooldown, timetable, linked cluster/preset/campaign and active status. Use after list_geozones to inspect one geozone. */ Get: GeozonesService_Get; /** Updates an existing geozone by its geozone code; only the fields you send are changed (PUT-style overwrite). Use to move coordinates, swap preset/content, change cooldown or range, toggle status, or reassign the cluster. */ Update: GeozonesService_Update; /** Lists geozones for one application (or across all account applications when application is empty), ordered by name or creation date, with paging and a name/code substring search. Use to browse geozones or find a geozone code. */ List: GeozonesService_List; /** Permanently deletes a geozone by its geozone code, removing the location trigger. Not undoable; use update_geozone to disable a geozone instead of deleting it. */ Delete: GeozonesService_Delete; } /** * Status reflects the user-set on/off switch for a Geozone or a GeozonesCluster. * Unlike is_active (which is derived from the timetable schedule), Status is * the persistent flag toggled by the user. */ export type Status = 'STATUS_UNSPECIFIED' | 'STATUS_ACTIVE' | 'STATUS_INACTIVE'; export type TimeInterval = { start: string; end: string; }; export type Ranges = { intervals: TimeInterval[]; }; export type Timetable = { timezone: number; ranges: Record; }; export type Properties = { iosSound: boolean; userdata: string; remotePage: string; inboxExpireDays: number; inboxIcon: string; }; export type Geozone = { code: string; application: string; name: string; content: Record; lat: number; lng: number; cooldown: Duration; range: number; isActive: boolean; cluster: string; preset: string; campaign: string; timetable: Timetable; properties: Properties; status: Status; }; export type CreateGeozonesRequest = { application?: string; name?: string; content?: Record; lat?: number; lng?: number; cooldown?: Duration; range?: number; cluster?: string; preset?: string; campaign?: string; timetable?: Timetable; properties?: Properties; }; export type CreateGeozonesResponse = { geozone: Geozone; }; export type GetGeozonesRequest = { code?: string; }; export type GetGeozonesResponse = { geozone: Geozone; }; export type UpdateGeozonesRequest = { code?: string; name?: string; content?: Record; lat?: number; lng?: number; cooldown?: Duration; range?: number; status?: Status; cluster?: string; preset?: string; campaign?: string; timetable?: Timetable; properties?: Properties; }; export type UpdateGeozonesResponse = { geozone: Geozone; }; export type ListGeozonesRequest_OrderBy = 'NAME' | 'CREATED'; export type ListGeozonesRequest_OrderDirection = 'ASC' | 'DESC'; export type ListGeozonesRequest = { application?: string; orderBy?: ListGeozonesRequest_OrderBy; orderDirection?: ListGeozonesRequest_OrderDirection; page?: number; perPage?: number; /** like %name% on name or code */ searchByName?: string; }; export type ListGeozonesResponse = { geozones: Geozone[]; page: number; perPage: number; total: number; }; export type DeleteGeozonesRequest = { application?: string; code?: string; }; export type DeleteGeozonesResponse = {};