Exemplo n.º 1
0
        public byte[] DownloadFile(string filePath)
        {
            var client = new Client(_fileUri + filePath);
            var request = new GetRequest();

            return client.SendSync(request);
        }
Exemplo n.º 2
0
        public File GetFile(string fileId)
        {
            var parameters = new Dictionary<string, string>
            {
                { "file_id", fileId }
            };

            var client = new Client(_uri + "getFile");
            var request = new GetRequest(parameters);
            var response = client.Send(request);

            return _responseParser.Parse<File>(response);
        }
Exemplo n.º 3
0
        public Update[] GetUpdates(int offset = 0, int limit = 100, int timeout = 0)
        {
            var parameters = new Dictionary<string, string>
            {
                { "offset", offset.ToString() },
                { "limit", limit.ToString() },
                { "timeout", timeout.ToString() }
            };

            var client = new Client(_uri + "getUpdates");
            var request = new GetRequest(parameters);
            var response = client.Send(request);

            return _responseParser.Parse<Update[]>(response);
        }