Constant tsproto_structs::book_to_messages::DATA_STR[][src]

pub const DATA_STR: &str = "# As in M2B from/to properties can be automatically mapped when they have\n# the same high-level name.\n\n[[rule]]\n# From the Book\nfrom = \"Channel\"\n# Into message\nto = \"ChannelEdit\"\noperation = \"update\"\n# The static message parameters\n# Can be often empty\n# Can be inferred from required message parameters\nids = [\n\t{ from=\"Id\", to=\"ChannelId\" },\n]\n# The dynamic message parameters\n# from is the property which gets updated, to is the field in the message\nproperties = [\n\t# Function which reads a value form the book and splits it up\n\t# into multiple message parameters\n\t# fn bla(Channel, MaxClientChannelInherited) -> (type of asd)\n\t#{ from=\"MaxClientChannelInherited\", function=\"Bla\", tolist=[\"asd\"] },\n\n\t{ from=\"password\", type=\"str?\", function=\"PasswordFlaggedB2m\", tolist=[\"HasPassword\", \"Password\"] }, # \'password\' is a helper\n\t{ from=\"ChannelType\", type=\"ChannelType\", function=\"ChannelTypeFunB2m\", tolist=[\"IsSemiPermanent\", \"IsPermanent\"] },\n\t{ from=\"MaxClients\", type=\"MaxClients\", function=\"MaxClientsFunB2m\", tolist=[\"MaxClients\", \"IsMaxClientsUnlimited\"] },\n\t{ from=\"MaxFamilyClients\", type=\"MaxClients\", function=\"MaxFamilyClientsFunB2m\", tolist=[\"MaxFamilyClients\", \"IsMaxFamilyClientsUnlimited\", \"InheritsMaxFamilyClients\"] },\n\t{ from=\"Description\", to=\"Description\" }, # From optional data\n]\n\n[[rule]]\nfrom = \"Channel\"\nto = \"ChannelDescriptionRequest\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ChannelId\" },\n]\n\n[[rule]]\nfrom = \"Channel\"\nto = \"ChannelMove\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ChannelId\" },\n\t{ from=\"Parent\", type=\"ChannelId\", function=\"ChannelIdB2m\", tolist=[\"ParentId\"] },\n\t{ from=\"Order\", type=\"ChannelId\", function=\"ChannelIdB2m\", tolist=[\"Order\"] },\n]\n\n# Filetransfer stuff for Channel\n\n[[rule]]\nfrom = \"Channel\"\nto = \"CreateDirectory\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ChannelId\" },\n\t{ from=\"Password\", type=\"str\", function=\"PasswordB2m\", tolist=[\"ChannelPassword\"] },\n\t{ from=\"Path\", to=\"DirectoryName\" },\n]\n\n[[rule]]\nfrom = \"Channel\"\nto = \"DeleteFile\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ChannelId\" },\n\t{ from=\"Password\", type=\"str\", function=\"PasswordB2m\", tolist=[\"ChannelPassword\"] },\n\t{ from=\"Path\", to=\"Name\" },\n]\n\n[[rule]]\nfrom = \"Channel\"\nto = \"FileListRequest\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ChannelId\" },\n\t{ from=\"Password\", type=\"str\", function=\"PasswordB2m\", tolist=[\"ChannelPassword\"] },\n\t{ from=\"Path\", to=\"Path\" },\n]\n\n[[rule]]\nfrom = \"Channel\"\nto = \"RenameFile\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ChannelId\" },\n\t{ from=\"Password\", type=\"str\", function=\"PasswordB2m\", tolist=[\"ChannelPassword\"] },\n\t{ from=\"FromPath\", to=\"OldName\" },\n\t{ from=\"ToPath\", to=\"NewName\" },\n]\nproperties = [\n\t{ from=\"ToChannel\", to=\"TargetChannelId\" },\n\t{ from=\"ToChannelPassword\", type=\"str\", function=\"PasswordB2m2\", tolist=[\"TargetChannelPassword\"] },\n]\n\n\n[[rule]]\nfrom = \"Client\"\nto = \"ClientConnectionInfoRequest\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ClientId\" },\n]\n\n[[rule]]\nfrom = \"Client\"\nto = \"ClientVariablesRequest\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ClientId\" },\n]\n\n[[rule]]\nfrom = \"Client\"\nto = \"ClientEdit\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ClientId\" },\n]\n\n[[rule]]\nfrom = \"Connection\"\nto = \"ClientUpdate\"\noperation = \"update\"\nproperties = [\n\t# The original properties are on the client object, but we can only change\n\t# our own properties, so these methods are available on the connection.\n\t{ from=\"Name\", to=\"Name\" },\n\t{ from=\"PhoneticName\", to=\"PhoneticName\" },\n\t{ from=\"InputMuted\", to=\"InputMuted\" },\n\t{ from=\"OutputMuted\", to=\"OutputMuted\" },\n\t{ from=\"InputHardwareEnabled\", to=\"InputHardwareEnabled\" },\n\t{ from=\"OutputHardwareEnabled\", to=\"OutputHardwareEnabled\" },\n\t{ from=\"IsChannelCommander\", to=\"IsChannelCommander\" },\n\t{ from=\"IsRecording\", to=\"IsRecording\" },\n\t{ from=\"AvatarHash\", to=\"AvatarHash\" },\n\t{ from=\"Away\", type=\"str?\", function=\"AwayFunB2m\", tolist=[\"IsAway\", \"AwayMessage\"] },\n\t{ from=\"TalkPowerRequest\", type=\"str?\", function=\"AwayFunB2m\", tolist=[\"TalkPowerRequest\", \"TalkPowerRequestMessage\"] },\n]\n\n[[rule]]\nfrom = \"Connection\"\nto = \"Disconnect\"\noperation = \"remove\"\n\n[[rule]]\nfrom = \"Connection\"\nto = \"PluginCommandRequest\"\noperation = \"update\"\nids = [\n\t{ from=\"Name\", to=\"Name\" },\n\t{ from=\"Data\", to=\"Data\" },\n\t{ from=\"Target\", to=\"Target\" },\n\t# TODO optional\n\t{ from=\"TargetClientId\", to=\"TargetClientId\" },\n]\n\n[[rule]]\nfrom = \"Client\"\nto = \"ServerGroupAddClient\"\noperation = \"add\"\nids = [\n\t{ from=\"DatabaseId\", to=\"ClientDbId\" },\n]\nproperties = [\n\t{ from=\"ServerGroup\", to=\"ServerGroupId\" },\n]\n\n[[rule]]\nfrom = \"Client\"\nto = \"ServerGroupDelClient\"\noperation = \"remove\"\nids = [\n\t{ from=\"DatabaseId\", to=\"ClientDbId\" },\n]\nproperties = [\n\t{ from=\"ServerGroup\", to=\"ServerGroupId\" },\n]\n\n[[rule]]\nfrom = \"Client\"\nto = \"ClientMove\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ClientId\" },\n\t{ from=\"Channel\", type=\"ChannelId\", function=\"ChannelIdB2m\", tolist=[\"ChannelId\"] },\n]\nproperties = [\n\t{ from=\"Password\", type=\"str\", function=\"PasswordB2m\", tolist=[\"ChannelPassword\"] },\n]\n\n[[rule]]\nfrom = \"Client\"\nto = \"ClientKick\"\noperation = \"update\"\nids = [\n\t{ from=\"Id\", to=\"ClientId\" },\n\t{ from=\"Reason\", to=\"Reason\" },\n]\nproperties = [\n\t{ from=\"ReasonMessage\", to=\"ReasonMessage\" },\n]\n\n[[rule]]\nfrom = \"Server\"\nto = \"FileListRequest\"\noperation = \"update\"\nids = [\n\t{ function=\"ZeroChannelId\", tolist=[\"ChannelId\"] },\n\t{ function=\"EmptyString\", tolist=[\"ChannelPassword\"] },\n\t{ from=\"Path\", to=\"Path\" },\n]\n\n[[rule]]\nfrom = \"Server\"\nto = \"DeleteFile\"\noperation = \"update\"\nids = [\n\t{ function=\"ZeroChannelId\", tolist=[\"ChannelId\"] },\n\t{ function=\"EmptyString\", tolist=[\"ChannelPassword\"] },\n\t{ from=\"Path\", to=\"Name\" },\n]\n\n[[rule]]\nfrom = \"Server\"\nto = \"ServerVariablesRequest\"\noperation = \"update\"\nids = [\n]\n\n[[rule]]\nfrom = \"Server\"\nto = \"ServerConnectionInfoRequest\"\noperation = \"update\"\nids = [\n]\n\n[[rule]]\nfrom = \"Server\"\nto = \"LogView\"\noperation = \"update\"\nids = [\n]\nproperties = [\n\t{ from=\"Lines\", to=\"Lines\" },\n\t{ from=\"Reverse\", to=\"Reverse\" },\n\t{ from=\"InstanceLog\", to=\"InstanceLog\" },\n\t{ from=\"Offset\", to=\"Offset\" },\n]\n\n[[rule]]\nfrom = \"Server\"\nto = \"ServerEdit\"\noperation = \"update\"\nids = [\n]\nproperties = [\n\t{ from=\"Password\", type=\"str?\", function=\"PasswordB2m\", tolist=[\"Password\"] },\n]\n\n[[rule]]\nfrom = \"ServerGroup\"\nto = \"ServerGroupAddClient\"\noperation = \"add\"\nids = [\n\t{ from=\"Id\", to=\"ServerGroupId\" },\n]\nproperties = [\n\t{ from=\"Client\", to=\"ClientDbId\" },\n]\n\n[[rule]]\nfrom = \"ServerGroup\"\nto = \"ServerGroupDelClient\"\noperation = \"remove\"\nids = [\n\t{ from=\"Id\", to=\"ServerGroupId\" },\n\t# Not an id attribute of the server group, but we want to have it as an\n\t# argument.\n\t{ from=\"Client\", to=\"ClientDbId\" },\n]\n";