using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace KdanCommon.GoogleCloud.Data.Vision { public partial class ImgesRequest { [JsonProperty("requests")] public ImageRequest[] Requests { get; set; } public ImgesRequest(List inputContents, string[] languageHints = null) { Requests = new ImageRequest[inputContents.Count]; for (int i = 0; i < inputContents.Count; i++) { Requests[i] = new ImageRequest() { Image = new Image() { Content = inputContents[i] }, Features = new Feature[] { new Feature() { Type = "TEXT_DETECTION" } }, ImageContext = new ImageContext() { LanguageHints = languageHints } }; } } } public partial class ImageRequest { [JsonProperty("image")] public Image Image { get; set; } [JsonProperty("features")] public Feature[] Features { get; set; } [JsonProperty("imageContext")] public ImageContext ImageContext { get; set; } } public partial class Feature { [JsonProperty("type")] public string Type { get; set; } } public partial class Image { [JsonProperty("content")] public string Content { get; set; } } public partial class ImageContext { [JsonProperty("languageHints")] public string[] LanguageHints { get; set; } } }