public async Task <GetResourceResult> GetResourceAsync(GetResourceParams parameters) { using ( var response = await Api.CallAsync(HttpMethod.Get, new UrlBuilder(Api.ApiUrlV.ResourceType("resources").Add(Api.GetCloudinaryParam(parameters.ResourceType)).Add(parameters.Type).Add(parameters.PublicId).BuildUrl(), parameters.ToParamsDictionary()).ToString(), null, null, null)) { return(await GetResourceResult.Parse(response)); } }
public void TestGetResourceParamsDictionary() { var parameters = new GetResourceParams(TestConstants.TestPublicId) { CinemagraphAnalysis = true }; var dictionary = parameters.ToParamsDictionary(); Assert.AreEqual("true", dictionary["cinemagraph_analysis"]); }
public GetResourceResult GetResource(GetResourceParams parameters) { UrlBuilder urlBuilder = new UrlBuilder( m_api.ApiUrlV. ResourceType("resources"). Add(Api.GetCloudinaryParam <ResourceType>(parameters.ResourceType)). Add(parameters.Type).Add(parameters.PublicId). BuildUrl(), parameters.ToParamsDictionary()); using (HttpWebResponse response = m_api.Call( HttpMethod.GET, urlBuilder.ToString(), null, null)) { GetResourceResult result = GetResourceResult.Parse(response); return(result); } }