import { RpcMethodV3 } from './commonTypes'; import { Common_FailedPreconditions as pushwoosh_rpc_errors_v3_Common_FailedPreconditions } from './pushwoosh_rpc_errors_v3'; export type PopupFormsContentsService_Save_FieldViolations = { reason: 'FV_SAVE_UNSPECIFIED'; field: string; description: string; } | { reason: 'NAME_EMPTY'; field: string; description: string; } | { reason: 'NAME_TOO_LONG'; field: string; description: string; args: { max_length: string; }; } | { reason: 'NAME_ALREADY_EXISTS'; field: string; description: string; args: { name: string; }; } | { reason: 'JSON_EMPTY'; field: string; description: string; } | { reason: 'JSON_INVALID'; field: string; description: string; }; export type PopupFormsContentsService_List_FieldViolations = { reason: 'FV_LIST_UNSPECIFIED'; field: string; description: string; } | { reason: 'PER_PAGE_TOO_LARGE'; field: string; description: string; args: { max_per_page: string; }; }; export type PopupFormsContentsService_Common_FailedPreconditions = { type: 'FP_UNSPECIFIED'; description: string; } | { type: 'POPUP_FORM_CONTENT_NOT_FOUND'; description: string; } | { type: 'POPUP_FORM_CONTENT_IN_USE'; description: string; }; export type PopupFormsContentsService_List = RpcMethodV3; export type PopupFormsContentsService_Get = RpcMethodV3; export type PopupFormsContentsService_Create = RpcMethodV3; export type PopupFormsContentsService_Update = RpcMethodV3; export type PopupFormsContentsService_Delete = RpcMethodV3; export interface PopupFormsContentsService { /** Lists popup form contents (web subscription-popup designs) for an application code XXXXX-XXXXX, ordered by updated or name, with paging and free-text search over name and code. Use to browse designs or find a content code before get/update/delete. */ List: PopupFormsContentsService_List; /** Returns one popup form content by its content code, including the frontend-generated json and optional html. Use after list_popup_form_contents to inspect a single design. */ Get: PopupFormsContentsService_Get; /** Creates a popup form content under an application code XXXXX-XXXXX from a name and frontend json; the server generates and returns the new content code. Name must be unique within the application, so a repeat call with the same name fails. */ Create: PopupFormsContentsService_Create; /** Overwrites a popup form content's name, json and html by content code. Use to save edits to an existing design; delete_popup_form_content removes it instead. */ Update: PopupFormsContentsService_Update; /** Deletes a popup form content by content code. Fails if any popup form still references it; a repeat call after deletion returns not-found. */ Delete: PopupFormsContentsService_Delete; } export type PopupFormsContentsService_Errors = { List: { fieldViolations: PopupFormsContentsService_List_FieldViolations[]; failedPreconditions: pushwoosh_rpc_errors_v3_Common_FailedPreconditions; }; Get: { failedPreconditions: pushwoosh_rpc_errors_v3_Common_FailedPreconditions; }; Create: { failedPreconditions: pushwoosh_rpc_errors_v3_Common_FailedPreconditions; }; Update: { failedPreconditions: pushwoosh_rpc_errors_v3_Common_FailedPreconditions; }; Delete: { failedPreconditions: pushwoosh_rpc_errors_v3_Common_FailedPreconditions; }; }; export type PopupFormContent = { /** Popup Form Content code. */ code: string; /** * Name of Popup Form Content. * Must be unique within the application. */ name: string; /** * Json of Popup Form Content. * This string is generated and used only on the frontend side. */ json: string; /** * Html of Popup Form Content. * This string is generated and used only on the frontend side. */ html?: string; /** Popup Form Content created timestamp. */ created: Date; /** Popup Form Content updated timestamp. */ updated: Date; }; export type ListRequest_OrderBy = 'UPDATED' | 'NAME'; export type ListRequest_OrderDirection = 'DESC' | 'ASC'; export type ListRequest = { /** Application code to filter by. */ application?: string; /** Search query to filter by name or code. */ search?: string; /** Field to order results by. */ orderBy?: ListRequest_OrderBy; /** Order direction. */ orderDirection?: ListRequest_OrderDirection; /** Page number. Pagination start from 0 */ page?: number; /** Number of items per page. */ perPage?: number; }; export type ListResponse_ListItem = { /** Similar to the PopupFormContent. */ code: string; /** Similar to the PopupFormContent. */ name: string; /** Similar to the PopupFormContent. */ json: string; /** Similar to the PopupFormContent. */ html?: string; /** Similar to the PopupFormContent. */ updated: Date; }; export type ListResponse = { /** List of Popup Form Contents for the current page. */ items: ListResponse_ListItem[]; /** Current page number. Pagination start from 0 */ page: number; /** Number of items per page. */ perPage: number; /** Total number of pages. */ totalPages: number; /** Total number of items across all pages. */ total: number; }; export type GetRequest = { /** Popup Form Content code identifying the design to fetch. */ code?: string; }; export type GetResponse = { /** Popup Form Content. */ item: PopupFormContent; }; export type CreateRequest = { /** Application code to which Popup Form Content belongs. */ application?: string; /** Similar to the PopupFormContent. */ name?: string; /** Similar to the PopupFormContent. */ json?: string; /** Similar to the PopupFormContent. */ html?: string; }; export type CreateResponse = { /** Similar to the PopupFormContent. */ code: string; }; export type UpdateRequest = { /** Popup Form Content code identifying the design to overwrite. */ code?: string; /** Similar to the PopupFormContent. */ name?: string; /** Similar to the PopupFormContent. */ json?: string; /** Similar to the PopupFormContent. */ html?: string; }; export type UpdateResponse = {}; export type DeleteRequest = { /** Popup Form Content code identifying the design to delete. */ code?: string; }; export type DeleteResponse = {};