/// <summary> /// Provides information regarding a specific resource /// </summary> /// <param name="resourceUuid"></param> /// <param name="projectId">(optional) Project ID, needed when requesting a resource that was uploaded by another user - e.g. as a project’s translation</param> /// <param name="fetch">(optional) possible values: false - (default) do not fetch content ; base64 - fetch content, base64 encoded</param> /// <returns></returns> public GetResourceResult GetResource(string resourceUuid, int projectId = 0, string fetch = "") { var r = new GetResourceResult(); try { if (GetResourceProvider == null) { GetResourceProvider = new GetResourceProvider(); } var json = GetResourceProvider.Get(Url, _proxy, KeyPublic, KeySecret, resourceUuid, projectId, fetch); r = JsonConvert.DeserializeObject <GetResourceResult>(json.Replace("\"results\":[", "\"resultsArray\":[")); } catch (Exception err) { r.Status.Code = -1; r.Status.Msg = err.Message; } return(r); }
/// <summary> /// Provides information regarding a specific resource /// </summary> /// <param name="resourceUuid"></param> /// <param name="projectId">(optional) Project ID, needed when requesting a resource that was uploaded by another user - e.g. as a project’s translation</param> /// <param name="fetch">(optional) possible values: false - (default) do not fetch content ; base64 - fetch content, base64 encoded</param> /// <returns></returns> public GetResourceResult GetResource(string resourceUuid, int projectId=0, string fetch="") { var r = new GetResourceResult(); try { if (GetResourceProvider == null) GetResourceProvider = new GetResourceProvider(); var json = GetResourceProvider.Get(Url, _proxy, KeyPublic, KeySecret, resourceUuid, projectId, fetch); r = JsonConvert.DeserializeObject<GetResourceResult>(json.Replace("\"results\":[", "\"resultsArray\":[")); } catch (Exception err) { r.Status.Code = -1; r.Status.Msg = err.Message; } return r; }