예제 #1
0
 protected TamTamUploadQuery(TamTamClient tamTamClient, string url, string fileName, Stream input)
     : base(tamTamClient, url)
 {
     _tamTamClient = tamTamClient;
     _url          = url;
     _uploadExec   = new StreamUploadExec(fileName, input, this);
 }
예제 #2
0
 public SendMessageQuery(TamTamClient client, NewMessageBody newMessageBody)
     : base(client, "/messages", newMessageBody, Method.POST)
 {
     _userId             = new QueryParam <long>("user_id", this);
     _chatId             = new QueryParam <long>("chat_id", this);
     _disableLinkPreview = new QueryParam <bool>("disable_link_preview", this);
 }
예제 #3
0
 public TamTamQuery(TamTamClient tamTamClient, string url, object body, Method method)
 {
     _tamTamClient = tamTamClient;
     _url          = url;
     _body         = body;
     _method       = method;
 }
예제 #4
0
 protected TamTamUploadQuery(TamTamClient tamTamClient, string url, FileInfo file)
     : base(tamTamClient, url)
 {
     _tamTamClient = tamTamClient;
     _url          = url;
     _uploadExec   = new FileUploadExec(file, this);
 }
예제 #5
0
 public GetMembersQuery(TamTamClient client, long chatId)
     : base(client, $"/chats/{chatId}/members", null, Method.GET)
 {
     _userIds = new QueryParam <List <long> >("user_ids", this);
     _marker  = new QueryParam <long>("marker", this);
     _count   = new QueryParam <int>("count", this);
 }
예제 #6
0
 public GetUpdatesQuery(TamTamClient client)
     : base(client, "/updates", null, Method.GET)
 {
     _limit   = new QueryParam <int>("limit", 100, this);
     _timeout = new QueryParam <int>("timeout", 30, this);
     _marker  = new QueryParam <long>("marker", this);
     _types   = new QueryParam <List <string> >("types", this);
 }
예제 #7
0
 public GetMessagesQuery(TamTamClient tamTamClient)
     : base(tamTamClient, "/messages", null, Method.GET)
 {
     _chatId     = new QueryParam <long>("chat_id", this);
     _messageIds = new QueryParam <List <string> >("message_ids", this);
     _from       = new QueryParam <long>("from", this);
     _to         = new QueryParam <long>("to", this);
     _count      = new QueryParam <int>("count", this);
 }
예제 #8
0
 public GetUploadUrlQuery(TamTamClient client, UploadType type)
     : base(client, "/uploads", null, Method.POST)
 {
     _type = new QueryParam <UploadType>("type", type, this).Required();
 }
예제 #9
0
 public GetMyInfoQuery(TamTamClient client)
     : base(client, "/me", null, Method.GET)
 {
 }
예제 #10
0
 public LeaveChatQuery(TamTamClient client, long chatId)
     : base(client, $"/chats/{chatId}/members/me", null, Method.DELETE)
 {
 }
예제 #11
0
 public GetSubscriptionsQuery(TamTamClient client)
     : base(client, "/subscriptions", null, Method.GET)
 {
 }
예제 #12
0
 public AddMembersQuery(TamTamClient client, UserIdsList userIdsList, long chatId)
     : base(client, $"/chats/{chatId}/members", userIdsList, Method.POST)
 {
 }
예제 #13
0
 public EditChatQuery(TamTamClient client, ChatPatch chatPatch, long chatId)
     : base(client, $"/chats/{chatId}", chatPatch, Method.PATCH)
 {
 }
예제 #14
0
 public TamTamUploadAPI(TamTamClient client)
 {
     this._client = client;
 }
예제 #15
0
 public UnsubscribeQuery(TamTamClient client, string url)
     : base(client, "/subscriptions", null, Method.DELETE)
 {
     _url = new QueryParam <string>("url", url, this).Required();
 }
예제 #16
0
 public GetChatsQuery(TamTamClient tamTamClient) : base(tamTamClient, "/chats", null, Method.GET)
 {
     _count  = new QueryParam <int>("count", this);
     _marker = new QueryParam <long>("marker", this);
 }
예제 #17
0
 public GetChatQuery(TamTamClient client, long chatId)
     : base(client, $"/chats/{chatId}", null, Method.GET)
 {
 }
예제 #18
0
 public GetAdminsQuery(TamTamClient client, long chatId)
     : base(client, $"/chats/{chatId}/members/admins", null, Method.GET)
 {
 }
예제 #19
0
 public RemoveMemberQuery(TamTamClient client, long chatId, long userId)
     : base(client, $"/chats/{chatId}/members", null, Method.DELETE)
 {
     _userId = new QueryParam <long>("user_id", userId, this).Required();
     _block  = new QueryParam <bool>("block", this);
 }
예제 #20
0
 public GetMessageByIdQuery(TamTamClient tamTamClient, string messageId)
     : base(tamTamClient, $"/messages/{messageId}", null, Method.GET)
 {
 }
예제 #21
0
 public ConstructQuery(TamTamClient client, ConstructorAnswer constructorAnswer, string sessionId)
     : base(client, "/answers/constructor", constructorAnswer, Method.POST)
 {
     _sessionId = new QueryParam <string>("message_id", sessionId, this).Required();
 }
예제 #22
0
 public SubscribeQuery(TamTamClient client, SubscriptionRequestBody subscriptionRequestBody)
     : base(client, "/subscriptions", subscriptionRequestBody, Method.POST)
 {
 }
예제 #23
0
 public DeleteMessageQuery(TamTamClient client, string messageId)
     : base(client, "/messages", null, Method.DELETE)
 {
     _messageId = new QueryParam <string>("message_id", messageId, this).Required();
 }
예제 #24
0
 public TamTamUploadFileQuery(TamTamClient tamTamClient, string url, string fileName, Stream input)
     : base(tamTamClient, url, fileName, input)
 {
 }
예제 #25
0
 public AnswerOnCallbackQuery(TamTamClient client, CallbackAnswer callbackAnswer, string callbackId)
     : base(client, "/answers", callbackAnswer, Method.POST)
 {
     _callbackId = new QueryParam <string>("callback_id", callbackId, this).Required();
 }
예제 #26
0
 public TamTamUploadFileQuery(TamTamClient tamTamClient, string url, FileInfo file)
     : base(tamTamClient, url, file)
 {
 }
예제 #27
0
 public EditMessageQuery(TamTamClient client, NewMessageBody newMessageBody, string messageId)
     : base(client, "/messages", newMessageBody, Method.PUT)
 {
     _messageId = new QueryParam <string>("message_id", messageId, this).Required();
 }
예제 #28
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="accessToken"></param>
 /// <returns></returns>
 public static TamTamBotApi Create(string accessToken)
 {
     return(new TamTamBotApi(TamTamClient.Create(accessToken)));
 }
예제 #29
0
 public TamTamBotApi(TamTamClient client)
 {
     _client = client;
 }
예제 #30
0
 public TamTamQuery(TamTamClient tamTamClient, string url, Method method) : this(tamTamClient, url, null, method)
 {
 }