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

Get data from collection(s) or whole project with optional additional filtering. All filters, unless explicitly noted otherwise, affect all hierarchy levels. To paginate and to get more data, use since parameter. 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. Returns Data Objects that are in a container with a read_data permission and associated with current user Data Objects that are in a container with a read_own_data permission.
public Get ( DataObjectRichQueryRequest request ) : Task>
request Syncano.Net.DataRequests.DataObjectRichQueryRequest Request for querying data objects.
Результат Task>
        public async Task Get_ByCollectionKey(DataObjectSyncanoClient client)
        {
            //given
            var newRequest = new DataObjectDefinitionRequest();
            newRequest.ProjectId = TestData.ProjectId;
            newRequest.CollectionKey = TestData.CollectionKey;
            var dataObject = await client.New(newRequest);

            var getRequest = new DataObjectRichQueryRequest();
            getRequest.ProjectId = TestData.ProjectId;
            getRequest.CollectionKey = TestData.CollectionKey;

            //when
            var result =
                await client.Get(getRequest);

            //then
            result.ShouldNotBeNull();
            result.Any(d => d.Id == dataObject.Id).ShouldBeTrue();

            //cleanup
            var deleteRequest = new DataObjectSimpleQueryRequest();
            deleteRequest.ProjectId = TestData.ProjectId;
            deleteRequest.CollectionId = TestData.CollectionId;
            await client.Delete(deleteRequest);
        }
        public async Task Get_Data1_OrderBy(DataObjectSyncanoClient client)
        {
            //given
            var newData1 = new DataObjectDefinitionRequest();
            newData1.ProjectId = TestData.ProjectId;
            newData1.CollectionId = TestData.CollectionId;
            newData1.DataOne = 1002;

            var newData2 = new DataObjectDefinitionRequest();
            newData2.ProjectId = TestData.ProjectId;
            newData2.CollectionId = TestData.CollectionId;
            newData2.DataOne = 1001;

            var dataObject1 = await client.New(newData1);
            var dataObject2 = await client.New(newData2);

            var getRequest = new DataObjectRichQueryRequest();
            getRequest.ProjectId = TestData.ProjectId;
            getRequest.CollectionId = TestData.CollectionId;
            getRequest.OrderBy  = DataObjectOrderBy.DataOne;
            getRequest.Order = DataObjectOrder.Ascending;
            getRequest.AddDataFieldFilter(DataObjectSpecialField.DataOne, DataObjectOperator.GreaterThan, 1000);

            //when
            var result =
                await client.Get(getRequest);

            //then
            result.ShouldNotBeNull();
            result.All(d => d.DataOne >1000).ShouldBeTrue();
            result.Count.ShouldEqual(2);
            result[0].Id.ShouldEqual(dataObject2.Id);
            result[1].Id.ShouldEqual(dataObject1.Id);

            //cleanup
            var deleteRequest = new DataObjectSimpleQueryRequest();
            deleteRequest.ProjectId = TestData.ProjectId;
            deleteRequest.CollectionId = TestData.CollectionId;
            await client.Delete(deleteRequest);
        }
        public async Task Get_WithToMuchFolders_ThrowsException(DataObjectSyncanoClient client)
        {
            //given
            var request = new DataObjectRichQueryRequest();
            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.Get(request);
                throw new Exception("Get should throw an exception");
            }
            catch (Exception e)
            {
                //then
                e.ShouldBeType<ArgumentException>();
            }
        }
        public async Task Get_WithToBigLimit_ThrowsException(DataObjectSyncanoClient client)
        {
            //given
            var request = new DataObjectRichQueryRequest();
            request.ProjectId = TestData.ProjectId;
            request.CollectionId = TestData.CollectionId;
            request.Limit = DataObjectSyncanoClient.MaxVauluesPerRequest + 1;

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

            try
            {
                //when
                await client.Get(request);
                throw new Exception("Get should throw an exception");
            }
            catch (Exception e)
            {
                //then
                e.ShouldBeType<ArgumentNullException>();
            }
        }
        public async Task Get_WithInvalidProjectId_ThrowsException(DataObjectSyncanoClient client)
        {
            //given
            var request = new DataObjectRichQueryRequest();
            request.ProjectId = "abc";
            request.CollectionId = TestData.CollectionId;

            try
            {
                //when
                await client.Get(request);
                throw new Exception("Get should throw an exception");
            }
            catch (Exception e)
            {
                //then
                e.ShouldBeType<SyncanoException>();
            }
        }