public GetCollectionsBrief GetImage(string collectionId, string imageId) { GetCollectionsBrief result = null; if (string.IsNullOrEmpty(collectionId)) { throw new ArgumentNullException(nameof(collectionId)); } if (string.IsNullOrEmpty(imageId)) { throw new ArgumentNullException(nameof(imageId)); } try { result = this.Client.GetAsync($"{this.Endpoint}{string.Format(PATH_COLLECTION_IMAGE, collectionId, imageId)}") .WithArgument("api_key", ApiKey) .WithArgument("version", VERSION_DATE_2016_05_20) .As <GetCollectionsBrief>() .Result; } catch (AggregateException ae) { throw ae.Flatten(); } return(result); }
private void OnGetImage(GetCollectionsBrief image, string customData) { if (image != null) { Log.Debug("TestVisualRecognition", "GetImage succeeded!"); Log.Debug("TestVisualRecognition", "imageID: {0} | created: {1} | image_file: {2} | metadata: {3}", image.image_id, image.created, image.image_file, image.metadata); } else { Log.Debug("TestVisualRecognition", "GetImage failed!"); } Test(image != null); m_ListImageDetailsTested = true; }