Exemplo n.º 1
0
        public static async Task <HttpResponseMessage> GetNodes(this OsdrWebClient client, string filter = null, string projection = null)
        {
            var stringProjection = "";

            if (projection != null)
            {
                stringProjection = $"&$projection={projection}";
            }

            if (filter != null)
            {
                return(await client.GetData($"api/nodes?$filter={filter}{stringProjection}"));
            }

            return(await client.GetData($"api/nodes"));
        }
        public static async Task <HttpResponseMessage> GetPublicEntity(this OsdrWebClient client, string type,
                                                                       int pageNumber = 1, int pageSize = 20, string filter = null, string projection = null)
        {
            HttpResponseMessage response = null;
            var stringProjection         = "";

            if (projection != null)
            {
                stringProjection = $"&$projection={projection}";
            }

            if (filter != null)
            {
                response = await client.GetData($"/api/entities/{type}/public?PageNumber={pageNumber}&PageSize={pageSize}&$filter={filter}{stringProjection}");
            }
            else
            {
                response = await client.GetData($"/api/entities/{type}/public?PageNumber={pageNumber}&PageSize={pageSize}&{stringProjection}");
            }

            return(response);
        }
        private async Task <IEnumerable <Guid> > GetNodeIdsForCategory(OsdrWebClient client, Guid categoryId)
        {
            var response = await client.GetData($"/api/categorytrees/tree/{categoryId}");

            response.EnsureSuccessStatusCode();
            var json = await response.Content.ReadAsStringAsync();

            json = json.Replace("_id", "id");
            var treeJson = JsonConvert.DeserializeObject <Dictionary <string, object> >(json)["nodes"].ToString();
            var tree     = JsonConvert.DeserializeObject <List <TreeNode> >(treeJson);

            return(tree.GetNodeIds());
        }
 public static async Task <HttpResponseMessage> GetBlobFileMetadataById(this OsdrWebClient client, Guid fileId, Guid blobId)
 {
     return(await client.GetData($"/api/entities/files/{fileId}/blobs/{blobId}/info"));
 }
 public static async Task <HttpResponseMessage> GetEntitiesMe(this OsdrWebClient client, string type)
 {
     return(await client.GetData($"api/entities/{type}/me"));
 }
 public static async Task <HttpResponseMessage> GetStreamById(this OsdrWebClient client, string type, Guid id, int start = 0, int count = -1)
 {
     return(await client.GetData($"/api/entities/{type}/{id}/stream?Start={start}&Count={count}"));
 }
Exemplo n.º 7
0
        public static async Task <HttpResponseMessage> GetUserPublicInfoById(this OsdrWebClient client, Guid userId)
        {
            var response = await client.GetData($"api/users/{userId}/public-info");

            return(response);
        }
Exemplo n.º 8
0
 public static async Task <HttpResponseMessage> GetPublicNodes(this OsdrWebClient client, Guid id)
 {
     return(await client.GetData($"/api/nodes/public?id={id}"));
 }
 public static async Task <HttpResponseMessage> GetEntitiesFolders(this OsdrWebClient client)
 {
     return(await client.GetData("api/entities/folders/me"));
 }
Exemplo n.º 10
0
 public static async Task <HttpResponseMessage> GetPageNumber(this OsdrWebClient client, Guid id, int pageSize)
 {
     return(await client.GetData($"api/nodes/{id}/page?pageSize={pageSize}"));
 }
Exemplo n.º 11
0
 public static async Task <HttpResponseMessage> GetNodesById(this OsdrWebClient client, Guid id)
 {
     return(await client.GetData($"/api/nodes/{id}/nodes"));
 }
Exemplo n.º 12
0
 public static async Task <HttpResponseMessage> GetNodesMe(this OsdrWebClient client)
 {
     return(await client.GetData("api/nodes/me"));
 }
Exemplo n.º 13
0
 public static async Task <HttpResponseMessage> NodesFindByField(this OsdrWebClient client, string fieldName, Guid id)
 {
     return(await client.GetData($"api/nodes?$filter={fieldName} eq '{id}'"));
 }
Exemplo n.º 14
0
 public static async Task <HttpResponseMessage> GetSharedFiles(this OsdrWebClient client)
 {
     return(await client.GetData("api/nodes/shared"));
 }
 public static async Task <HttpResponseMessage> GetRecordEntityById(this OsdrWebClient client, Guid id)
 {
     return(await client.GetData($"/api/entities/records/{id}"));
 }
Exemplo n.º 16
0
 public static async Task <HttpResponseMessage> GetOSDRVersion(this OsdrWebClient client)
 {
     return(await client.GetData("/api/version"));
 }
 public static async Task <HttpResponseMessage> GetFolder(this OsdrWebClient client, Guid id)
 {
     return(await client.GetData($"api/entities/folders/{id}"));
 }
Exemplo n.º 18
0
        public static async Task <HttpResponseMessage> GetUserMe(this OsdrWebClient client)
        {
            var response = await client.GetData("api/me");

            return(response);
        }
 public static async Task <HttpResponseMessage> GetEntityById(this OsdrWebClient client, string type, Guid id)
 {
     return(await client.GetData($"/api/entities/{type}/{id}"));
 }
Exemplo n.º 20
0
 public static async Task <HttpResponseMessage> GetPredictionStatus(this OsdrWebClient client, Guid id)
 {
     return(await client.GetData($"api/machinelearning/predictions/{id}/status"));
 }