Exemplo n.º 1
0
 public async Task FilesRemote_Update()
 {
     var request = new UpdateFileRemoteRequest
     {
         ExternalId = "1234",
         Title      = "hello",
         Filetype   = "txt",
         File       = "ABCD"
     };
     await Utility.AssertEncodedWebApi(c => c.Files.Remote.Update(request), "files.remote.update",
                                       "Web_FilesInfo.json", nvc =>
     {
         Assert.Equal("1234", nvc["external_id"]);
         Assert.Equal("hello", nvc["title"]);
         Assert.Equal("txt", nvc["filetype"]);
         Assert.Equal("ABCD", nvc["file"]);
     });
 }
Exemplo n.º 2
0
        public Task <FileResponse> Update(UpdateFileRemoteRequest request)
        {
            if (request.IndexableFileContents == null && request.PreviewImage == null)
            {
                return(_client.MakeUrlEncodedCall <FileResponse>("files.remote.update", request));
            }

            var dict = new Dictionary <string, MultipartFile>();

            if (request.IndexableFileContents != null)
            {
                dict.Add("indexable_file_contents", request.IndexableFileContents);
            }

            if (request.PreviewImage != null)
            {
                dict.Add("preview_image", request.PreviewImage);
            }

            return(_client.MakeMultiPartCall <FileResponse>("files.remote.update", request, dict));
        }