using System;
using System.Collections.Generic;
using System.Text;
namespace MatrixDotNetLib
{
public class MatrixApi
{
public static class Server
{
///
/// Gets discovery information about the domain.
///
///
/// https://matrix.org/docs/api/client-server/#!/Server32administration/getWellknown
///
public static string Discovery = "/.well-known/matrix/client";
///
/// Gets the versions of the specifications supported by the server.
///
///
/// https://matrix.org/docs/api/client-server/#!/Server32administration/getVersions
///
public static string Versions = "/_matrix/client/versions";
///
/// Gets information about the server's supported feature set and other relevant capabilities.
///
///
/// https://matrix.org/docs/api/client-server/#!/Capabilities/getCapabilities
///
public static string Capabilities = "/_matrix/client/r0/capabilities";
///
/// Gets information about a particular user.
///
///
/// https://matrix.org/docs/api/client-server/#!/Server32administration/getWhoIs
///
public static string Whois = "/_matrix/client/r0/admin/whois/{UserId}";
///
/// Performs a full text search across different categories. Posts with a search object.
///
///
/// https://matrix.org/docs/api/client-server/#!/Search/search
///
public static string Search = "/_matrix/client/r0/search";
///
/// Performs a user search. Posts with a user search object.
///
///
/// https://matrix.org/docs/api/client-server/#!/User32data/searchUserDirectory
///
public static string UserSearch = "/_matrix/client/r0/user_directory/search";
///
/// Lists the public rooms on the server. Posts with a filter object.
///
///
/// https://matrix.org/docs/api/client-server/#!/Room32discovery/getPublicRooms
///
public static string RoomList = "/_matrix/client/r0/publicRooms";
///
/// Updates the visibility of a given room in the directory. Puts a visibility object.
///
///
/// https://matrix.org/docs/api/client-server/#!/Application32service32room32directory32management/updateAppserviceRoomDirectoryVsibility
///
public static string ManageRooms = "/_matrix/client/r0/directory/list/appservice/{NetworkId}/{RoomId}";
///
/// Upgrades the given room to a particular room version. Posts with a room upgrade object.
///
///
/// https://matrix.org/docs/api/client-server/#!/Room32upgrades/upgradeRoom
///
public static string UpgradeRoom = "/_matrix/client/r0/rooms/{RoomId}/upgrade";
///
/// Gets an OpenID token object for use with another service. Posts with a userId parameter.
///
///
/// https://matrix.org/docs/api/client-server/#!/OpenID/requestOpenIdToken
///
public static string Openid = "/_matrix/client/r0/user/{UserId}/openid/request_token";
///
/// Gets client credentials for use when initiating a call.
///
///
/// https://matrix.org/docs/api/client-server/#!/VOIP/getTurnServer
///
public static string Voip = "/_matrix/client/r0/voip/turnServer";
}
public static class Key
{
///
/// Gets a list of users who have updated their device identity keys.
///
///
/// https://matrix.org/docs/api/client-server/#!/End45to45end32encryption/getKeysChanges
///
public static string Latest = "/_matrix/client/r0/keys/changes";
///
/// Claims one-time keys for use in pre-key messages. Posts with a key object.
///
///
/// https://matrix.org/docs/api/client-server/#!/End45to45end32encryption/claimKeys
///
public static string Claim = "/_matrix/client/r0/keys/claim";
///
/// Returns the current devices and identity keys for the given users. Posts with a key object.
///
///
/// https://matrix.org/docs/api/client-server/#!/End45to45end32encryption/queryKeys
///
public static string Download = "/_matrix/client/r0/keys/query";
///
/// Publishes end-to-end encryption keys for the device. Posts with a key object.
///
///
/// https://matrix.org/docs/api/client-server/#!/End45to45end32encryption/uploadKeys
///
public static string Upload = "/_matrix/client/r0/keys/upload";
}
public static class Device
{
///
/// Private string for device URL
///
private static string _deviceIdUrl = "/_matrix/client/r0/devices/{DeviceId}";
///
/// Gets information about all devices for the current user.
///
///
/// https://matrix.org/docs/api/client-server/#!/Device32management/getDevices
///
public static string Manage = "/_matrix/client/r0/devices";
///
/// Deletes the given device, and invalidates any access token associated with it. Deletes with interactive auth object and deviceId parameter.
///
///
/// https://matrix.org/docs/api/client-server/#!/Device32management/deleteDevice
///
public static string Delete = _deviceIdUrl;
///
/// Gets information on a single device, by device id. Gets with deviceId parameter.
///
///
/// https://matrix.org/docs/api/client-server/#!/Device32management/getDevice
///
public static string Info = _deviceIdUrl;
///
/// Updates the metadata (display name) on the given device. Puts a device metadata object with deviceId parameter.
///
///
/// https://matrix.org/docs/api/client-server/#!/Device32management/updateDevice
///
public static string Update = _deviceIdUrl;
///
/// Deletes the given devices, and invalidates any access token associated with them. Posts with an interactive auth + device list object.
///
///
/// https://matrix.org/docs/api/client-server/#!/Device32management/deleteDevices
///
public static string MultiDelete = "/_matrix/client/r0/delete_devices";
///
/// Sends send-to-device events to the given devices. Puts a device message object with eventType and txnId parameters.
///
///
/// https://matrix.org/docs/api/client-server/#!/Send45to45Device32messaging/sendToDevice
///
public static string Send = "/_matrix/client/r0/sendtodevice/{EventType}/{TxnId}";
}
public static class Media
{
///
///
///
///
///
///
public static string Config = "/_matrix/media/r0/config";
///
///
///
///
///
///
public static string Save = "/_matrix/media/r0/download/{ServerName}/{MediaId}";
///
///
///
///
///
///
public static string Saveas = "/_matrix/media/r0/download/{ServerName}/{MediaId}/{Filename}";
///
///
///
///
///
///
public static string Preview = "/_matrix/media/r0/preview_url";
///
///
///
///
///
///
public static string Thumb = "/_matrix/media/r0/thumbnail/{ServerName}/{MediaId}";
///
///
///
///
///
///
public static string Upload = "/_matrix/media/r0/upload";
}
public static class Notifier
{
///
///
///
///
///
///
public static string Notifiers = "/_matrix/client/r0/notifications";
///
///
///
///
///
///
public static string Pushers = "/_matrix/client/r0/pushers";
///
///
///
///
///
///
public static string Set = "/_matrix/client/r0/pushers/set";
///
///
///
///
///
///
public static string Rules = "/_matrix/client/r0/pushrules/";
}
public static class NotifierRule
{
///
///
///
///
///
///
public static string Manage = "/_matrix/client/r0/pushrules/{scope}/{Kind}/{RuleId}";
///
///
///
///
///
///
public static string Actions = "/_matrix/client/r0/pushrules/{scope}/{Kind}/{RuleId}/actions";
///
///
///
///
///
///
public static string Toggle = "/_matrix/client/r0/pushrules/{scope}/{Kind}/{RuleId}/enabled";
}
public static class User
{
///
///
///
///
///
///
public static string Thirdparty = "/_matrix/client/r0/account/3pid";
///
///
///
///
///
///
public static string Deactivate = "/_matrix/client/r0/account/deactivate";
///
///
///
///
///
///
public static string Password = "/_matrix/client/r0/account/password";
///
///
///
///
///
///
public static string Register = "/_matrix/client/r0/register";
///
///
///
///
///
///
public static string WhoAmI = "/_matrix/client/r0/account/whoami";
///
///
///
///
///
///
public static string Profile = "/_matrix/client/r0/profile/{UserId}";
///
///
///
///
///
///
public static string Avatar = "/_matrix/client/r0/profile/{UserId}/avtatar_url";
///
///
///
///
///
///
public static string DisplayName = "/_matrix/client/r0/profile/{UserId}/displayname";
///
///
///
///
///
///
public static string ExtraInfo = "/_matrix/client/r0/user/{UserId}/account_data/{type}";
///
///
///
///
///
///
public static string EventFilter = "/_matrix/client/r0/user/{UserId}/filter";
///
/// Gets a list of the user's current rooms.
///
///
/// https://matrix.org/docs/api/client-server/#!/Room32membership/getJoinedRooms
///
public static string Rooms = "/_matrix/client/r0/joined_rooms";
///
///
///
///
///
///
public static string Login = "/_matrix/client/r0/login";
///
///
///
///
///
///
public static string Logout = "/_matrix/client/r0/logout";
///
///
///
///
///
///
public static string Status = "/_matrix/client/r0/presence/{UserId}/status";
}
public static class UserRoom
{
///
///
///
///
///
///
public static string Extrainfo = "/_matrix/client/r0/user/{UserId}/rooms/{RoomId}/account_data/{type}";
///
///
///
///
///
///
public static string Tags = "/_matrix/client/r0/user/{UserId}/rooms/{RoomId}/tags";
}
public static class Room
{
///
/// Private string for room URL
///
private static string roomBase = "/_matrix/client/r0/rooms/{RoomId}";
///
///
///
///
///
///
public static string Create = "/_matrix/client/r0/createRoom";
///
///
///
///
///
///
public static string Aliases = "/_matrix/client/unstable/org.matrix.msc2432/rooms/{RoomId}/aliases";
///
///
///
///
///
///
public static string Active = roomBase + "/joined_members";
///
///
///
///
///
///
public static string Members = roomBase + "/members";
///
///
///
///
///
///
public static string Messages = roomBase + "/messages";
///
///
///
///
///
///
public static string Join = "/_matrix/client/r0/join/{RoomIdOrAlias}";
///
///
///
///
///
///
public static string Ban = roomBase + "/ban";
///
///
///
///
///
///
public static string Forget = roomBase + "/forget";
///
///
///
///
///
///
public static string Invite = roomBase + "/invite";
///
/// Starts the user participating in the given room. Posts RoomId (not alias).
///
///
/// https://matrix.org/docs/api/client-server/#!/Room32membership/joinRoomById
///
public static string IdJoin = roomBase + "/join";
///
///
///
///
///
///
public static string Kick = roomBase + "/kick";
///
///
///
///
///
///
public static string Leave = roomBase + "/leave";
///
///
///
///
///
///
public static string Unban = roomBase + "/unban";
///
///
///
///
///
///
public static string Marker = roomBase + "/read_markers";
}
public static class RoomEvent
{
///
///
///
///
///
///
public static string Context = "/_matrix/client/r0/rooms/{RoomId}/context/{EventId}";
///
///
///
///
///
///
public static string Event = "/_matrix/client/r0/rooms/{RoomId}/event/{EventId}";
///
///
///
///
///
///
public static string Receipt = "/_matrix/client/r0/rooms/{RoomId}/receipt/{ReceiptType}/{EventId}";
///
///
///
///
///
///
public static string Redact = "/_matrix/client/r0/rooms/{RoomId}/redact/{EventId}/{TxnId}";
///
///
///
///
///
///
public static string Send = "/_matrix/client/r0/rooms/{RoomId}/send/{EventType}/{TxnId}";
///
///
///
///
///
///
public static string Typing = "/_matrix/client/r0/rooms/{RoomId}/typing/{UserId}";
///
///
///
///
///
///
public static string Flag = "/_matrix/client/r0/rooms/{RoomId}/report/{EventId}";
}
public static class RoomState
{
///
///
///
///
///
///
public static string List = "/_matrix/client/r0/rooms/{RoomId}/state";
///
///
///
///
///
///
public static string State = "/_matrix/client/r0/rooms/{RoomId}/state/{EventType}/{StateKey}";
}
}
//public static Dictionary Server = new Dictionary()
//{
// { "discovery", "/.well-known/matrix/client" },
// { "versions", "/_matrix/client/versions" },
// { "capabilities", "/_matrix/client/r0/capabilities" },
// { "whois", "/_matrix/client/r0/admin/whois/{userId}" },
// { "search", "/_matrix/client/r0/search" },
// { "usersearch", "/_matrix/client/r0/user_directory/search" },
// { "roomlist", "/_matrix/client/r0/publicRooms" },
// { "managerooms", "/_matrix/client/r0/directory/list/appservice/{networkId}/{roomId}" },
// { "upgraderoom", "/_matrix/client/r0/rooms/{roomId}/upgrade" },
// { "openid", "/_matrix/client/r0/user/{userId}/openid/request_token" },
// { "voip", "/_matrix/client/r0/voip/turnServer" }
//};
//public static Dictionary Key = new Dictionary()
//{
// { "latest", "/_matrix/client/r0/keys/changes" },
// { "claim", "/_matrix/client/r0/keys/claim" },
// { "download", "/_matrix/client/r0/keys/query" },
// { "upload", "/_matrix/client/r0/keys/upload" }
//};
//public static Dictionary Device = new Dictionary()
//{
// { "manage", "/_matrix/client/r0/devices" },
// { "multidelete", "/_matrix/client/r0/delete_devices" },
// { "send", "/_matrix/client/r0/sendToDevice/{eventType}/{txnId}" }
//};
//public static Dictionary Media = new Dictionary()
//{
// { "config", "/_matrix/media/r0/config" },
// { "save", "/_matrix/media/r0/download/{serverName}/{mediaId}" },
// { "saveas", "/_matrix/media/r0/download/{serverName}/{mediaId}/{fileName}" },
// { "preview", "/_matrix/media/r0/preview_url" },
// { "thumb", "/_matrix/media/r0/thumbnail/{serverName}/{mediaId}" },
// { "upload", "/_matrix/media/r0/upload" }
//};
//public static Dictionary Notifier = new Dictionary()
//{
// { "notifiers", "/_matrix/client/r0/notifications" },
// { "pushers", "/_matrix/client/r0/pushers" },
// { "set", "/_matrix/client/r0/pushers/set" },
// { "rules", "/_matrix/client/r0/pushrules/" }
//};
//public static Dictionary NotifierRule = new Dictionary()
//{
// { "manage", "/_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}" },
// { "actions", "/_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/actions" },
// { "toggle", "/_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/enabled" }
//};
//public static Dictionary User = new Dictionary()
//{
// { "thirdparty", "/_matrix/client/r0/account/3pid" },
// { "deactivate", "/_matrix/client/r0/account/deactivate" },
// { "password", "/_matrix/client/r0/account/password" },
// { "register", "/_matrix/client/r0/register" },
// { "whoami", "/_matrix/client/r0/account/whoami" },
// { "profile", "/_matrix/client/r0/profile/{userId}" },
// { "avatar", "/_matrix/client/r0/profile/{userId}/avtatar_url" },
// { "displayname", "/_matrix/client/r0/profile/{userId}/displayname" },
// { "extrainfo", "/_matrix/client/r0/user/{userId}/account_data/{type}" },
// { "eventfilter", "/_matrix/client/r0/user/{userId}/filter" },
// { "rooms", "/_matrix/client/r0/joined_rooms" },
// { "login", "/_matrix/client/r0/login" },
// { "logout", "/_matrix/client/r0/logout" },
// { "status", "/_matrix/client/r0/presence/{userId}/status" }
//};
//public static Dictionary UserRoom = new Dictionary()
//{
// { "extrainfo", "/_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type}" },
// { "tags", "/_matrix/client/r0/user/{userId}/rooms/{roomId}/tags" }
//};
//public static Dictionary Room = new Dictionary()
//{
// { "create", "/_matrix/client/r0/createRoom" },
// { "aliases", "/_matrix/client/unstable/org.matrix.msc2432/rooms/{roomId}/aliases" },
// { "active", "/_matrix/client/r0/rooms/{roomId}/joined_members" },
// { "members", "/_matrix/client/r0/rooms/{roomId}/members" },
// { "messages", "/_matrix/client/r0/rooms/{roomId}/messages" },
// { "join", "/_matrix/client/r0/join/{roomIdOrAlias}" },
// { "ban", "/_matrix/client/r0/rooms/{roomId}/ban" },
// { "forget", "/_matrix/client/r0/rooms/{roomId}/forget" },
// { "invite", "/_matrix/client/r0/rooms/{roomId}/invite" },
// { "idjoin", "/_matrix/client/r0/rooms/{roomId}/join" },
// { "kick", "/_matrix/client/r0/rooms/{roomId}/kick" },
// { "leave", "/_matrix/client/r0/rooms/{roomId}/leave" },
// { "unban", "/_matrix/client/r0/rooms/{roomId}/unban" },
// { "marker", "/_matrix/client/r0/rooms/{roomId}/read_markers" }
//};
//public static Dictionary RoomEvent = new Dictionary()
//{
// { "context", "/_matrix/client/r0/rooms/{roomId}/context/{eventId}" },
// { "event", "/_matrix/client/r0/rooms/{roomId}/event/{eventId}" },
// { "receipt", "/_matrix/client/r0/rooms/{roomId}/receipt/{receiptType}/{eventId}" },
// { "redact", "/_matrix/client/r0/rooms/{roomId}/redact/{eventId}/{txnId}" },
// { "send", "/_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}" },
// { "typing", "/_matrix/client/r0/rooms/{roomId}/typing/{userId}" },
// { "flag", "/_matrix/client/r0/rooms/{roomId}/report/{eventId}" }
//};
//public static Dictionary RoomState = new Dictionary()
//{
// { "list", "/_matrix/client/r0/rooms/{roomId}/state" },
// { "state", "/_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}" }
//};
//public Dictionary Entities = new Dictionary()
//{
// { "deviceId", "" },
// { "eventId", "" },
// { "eventType", "" },
// { "fileName", "" },
// { "filterId", "" },
// { "kind", "" },
// { "mediaId", "" },
// { "networkId", "" },
// { "receiptType", "" },
// { "roomAlias", "" },
// { "roomId", "" },
// { "roomIdOrAlias", "" },
// { "ruleId", "" },
// { "scope", "" },
// { "serverName", "" },
// { "stateKey", "" },
// { "tags", "" },
// { "txnId", "" },
// { "type", "" },
// { "userId", "" }
//};
}