private void generateParameters(IDictionary <string, string> parameters, Models.Products.PrivateEmbedGenerateModel features) { if (features == null) { return; } this.generateParameters(parameters, (Models.Products.EmbedGenerateModel)features); if (string.IsNullOrEmpty(features.AccessPeriod) == false) { parameters.Add(new KeyValuePair <string, string>("accessPeriod", features.AccessPeriod)); } }
public async Task <string> GeneratePrivateIframeTagAsync(int id, Models.Products.PrivateEmbedGenerateModel features) { var parameters = new Dictionary <string, string>(); parameters.Add("id", id.ToString()); this.generateParameters(parameters, features); var queryString = parameters.ToQueryString(); var url = ApiUrls.PrivateEmbedUrl; if (!string.IsNullOrEmpty(queryString)) { url = url + "?" + queryString; } var model = await this.GetAsync <Models.Products.EmbedResponse>(url); if (model == null) { return(string.Empty); } return(model.Content); }