Move() публичный Метод

Moves data to a folder and/or state. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Updates only data that are in a container with an update_data permission (or update_own_data for Data Objects associated with current user).
public Move ( DataObjectSimpleQueryRequest request, string newFolder = null, DataObjectState newState = null ) : Task
request Syncano.Net.DataRequests.DataObjectSimpleQueryRequest Request for querying DataObjects.
newFolder string Destination folder where data will be moved. If not specified, leaves folder as is.
newState DataObjectState State to be set data for specified data. Accepted values: Pending, Moderated. If not specified, leaves state as is.
Результат Task
        public async Task Move_WithToMuchFolders_ThrowsException(DataObjectSyncanoClient client)
        {
            //given
            var request = new DataObjectSimpleQueryRequest();
            request.ProjectId = TestData.ProjectId;
            request.CollectionId = TestData.CollectionId;
            request.Folders = new List<string>();
            for (int i = 0; i < DataObjectSyncanoClient.MaxVauluesPerRequest; ++i)
                request.Folders.Add("abc");
            request.Folder = "abc";

            try
            {
                //when
                await client.Move(request);
                throw new Exception("Move should throw an exception");
            }
            catch (Exception e)
            {
                //then
                e.ShouldBeType<ArgumentException>();
            }
        }
        public async Task Move_WithNullCollectionIdAndCollectionKey_ThrowsException(DataObjectSyncanoClient client)
        {
            //given
            var request = new DataObjectSimpleQueryRequest();
            request.ProjectId = TestData.ProjectId;

            try
            {
                //when
                await client.Move(request);
                throw new Exception("Move should throw an exception");
            }
            catch (Exception e)
            {
                //then
                e.ShouldBeType<ArgumentNullException>();
            }
        }
        public async Task Move_WithToBigLimit_ThrowsException(DataObjectSyncanoClient client)
        {
            //given
            var request = new DataObjectSimpleQueryRequest();
            request.ProjectId = TestData.ProjectId;
            request.CollectionId = TestData.CollectionId;
            request.Limit = DataObjectSyncanoClient.MaxVauluesPerRequest + 1;

            try
            {
                //when
                await client.Move(request);
                throw new Exception("Move should throw an exception");
            }
            catch (Exception e)
            {
                //then
                e.ShouldBeType<ArgumentException>();
            }
        }
        public async Task Move_ByCollectionKey_WithFolderAndState(DataObjectSyncanoClient client)
        {
            //given
            var folderClient =
                new FolderSyncanoClient(new SyncanoHttpClient(TestData.InstanceName, TestData.BackendAdminApiKey));
            var folderOne = await folderClient.New(TestData.ProjectId, "folderOne", TestData.CollectionId);
            var folderTwo = await folderClient.New(TestData.ProjectId, "folderTwo", TestData.CollectionId);
            var newRequest = new DataObjectDefinitionRequest();
            newRequest.ProjectId = TestData.ProjectId;
            newRequest.CollectionKey = TestData.CollectionKey;
            newRequest.Folder = folderOne.Name;
            newRequest.State = DataObjectState.Pending;
            var dataObject = await client.New(newRequest);

            var moveRequest = new DataObjectSimpleQueryRequest();
            moveRequest.ProjectId = TestData.ProjectId;
            moveRequest.CollectionKey = TestData.CollectionKey;
            moveRequest.DataId = dataObject.Id;

            //when
            var result = await client.Move(moveRequest, folderTwo.Name, DataObjectState.Moderated);
            var resultObject =
                await client.GetOne(TestData.ProjectId, TestData.CollectionId, dataId: dataObject.Id);

            //then
            result.ShouldBeTrue();
            resultObject.Folder.ShouldEqual(folderTwo.Name);

            //cleanup
            await client.Delete(moveRequest);
            await folderClient.Delete(TestData.ProjectId, folderOne.Name, TestData.CollectionId);
            await folderClient.Delete(TestData.ProjectId, folderTwo.Name, TestData.CollectionId);
        }