import { RpcMethod } from './commonTypes'; export type TagsService_Get = RpcMethod; export type TagsService_Create = RpcMethod; export type TagsService_Delete = RpcMethod; export type TagsService_List = RpcMethod; export type TagsService_GetTagValues = RpcMethod; export type TagsService_GetTagUsage = RpcMethod; export interface TagsService { /** Returns a single account tag (user/device attribute) by name, including its value type and whether it is system-defined or user-specific. Use after list_tags to inspect one tag before editing segments or profiles. */ Get: TagsService_Get; /** Creates a new account tag with the given name and value type. Fails if a tag of that name already exists; timezone-typed tags cannot be created here. */ Create: TagsService_Create; /** Permanently deletes an account tag by name. Refuses to delete system or reserved tags, or tags still referenced by any segment, in-app or journey; check get_tag_usage first. */ Delete: TagsService_Delete; /** Lists the account's tags, newest or name-ordered, with paging, name substring search and an optional type filter. Use to browse tags or find a tag name before fetching values or usage. */ List: TagsService_List; /** Returns the distinct stored values of a tag in an application with per-value subscriber counts, filtered by substring and paged. Use to see which values a string/list tag actually holds; integer and price tags return no values. */ GetTagValues: TagsService_GetTagValues; /** Returns the segments, in-apps and journeys that reference a tag by name. Use to find what would break before deleting or editing a tag. */ GetTagUsage: TagsService_GetTagUsage; } export type GetTagRequest = { /** Tag name to fetch. */ name?: string; }; export type Tag_Type = 'UNKNOWN' | 'INTEGER' | 'STRING' | 'LIST' | 'DATE' | 'BOOLEAN' | 'PRICE' | 'VERSION' | 'TIMEZONE'; export type Tag = { name: string; type: Tag_Type; system: boolean; userSpecific: boolean; hasRightAceModify: boolean; }; export type CreateTagRequest = { /** Tag name to create (letters, digits, spaces and dashes; max 64 chars). */ name?: string; /** Value type of the tag; TIMEZONE is not allowed here. */ type?: Tag_Type; /** If true the tag is stored per user id rather than per device. */ userSpecific?: boolean; }; export type CreateTagResponse = { tag: Tag; }; export type DeleteTagRequest = { /** Tag name to delete. */ name?: string; }; export type DeleteTagResponse = {}; export type ListTagsRequest_OrderBy = 'NAME' | 'CREATED'; export type ListTagsRequest_OrderDirection = 'ASC' | 'DESC'; export type ListTagsRequest = { /** like %name% */ searchByName?: string; orderBy?: ListTagsRequest_OrderBy; orderDirection?: ListTagsRequest_OrderDirection; page?: number; perPage?: number; /** filter by tag types, empty means all */ types?: Tag_Type[]; }; export type ListTagsResponse = { tags: Tag[]; page: number; perPage: number; total: number; }; export type GetTagValuesRequest_OrderBy = 'VALUE' | 'COUNT'; export type GetTagValuesRequest_OrderDirection = 'ASC' | 'DESC'; export type GetTagValuesRequest_LikeOperator = 'STARTS_WITH' | 'ENDS_WITH' | 'CONTAINS'; export type GetTagValuesRequest = { /** Application code (format XXXXX-XXXXX) whose stored tag values to count. */ application?: string; /** Tag name whose values to return. */ name?: string; /** Substring to filter values by, applied per like_op. */ like?: string; likeOp?: GetTagValuesRequest_LikeOperator; orderBy?: GetTagValuesRequest_OrderBy; orderDirection?: GetTagValuesRequest_OrderDirection; limit?: number; offset?: number; /** additional pagination for front */ page?: number; perPage?: number; /** * Device platform codes to count values on; empty means every platform. * User-level tag values are counted under platform 0 and match no filter. */ platforms?: number[]; }; export type GetTagValuesResponse_TagValue = { value: string; count: number; }; export type GetTagValuesResponse = { values: GetTagValuesResponse_TagValue[]; total: number; page: number; perPage: number; }; export type GetTagUsageRequest = { /** Tag name whose references (segments, in-apps, journeys) to return. */ name?: string; }; export type GetTagUsageResponse_Journey = { uuid: string; title: string; status: number; }; export type GetTagUsageResponse_Inapp = { code: string; name: string; status: string; }; export type GetTagUsageResponse_Filter = { code: string; name: string; }; export type GetTagUsageResponse = { journeys: GetTagUsageResponse_Journey[]; inapps: GetTagUsageResponse_Inapp[]; filters: GetTagUsageResponse_Filter[]; };