public InsertSearchItemResponse InsertSearchItem(string tabId, InsertSearchItemRequest request) { AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions(); InsertSearchItemHeaders headers = new InsertSearchItemHeaders(); return(InsertSearchItemWithOptions(tabId, request, headers, runtime)); }
public InsertSearchItemResponse InsertSearchItemWithOptions(string tabId, InsertSearchItemRequest request, InsertSearchItemHeaders headers, AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime) { AlibabaCloud.TeaUtil.Common.ValidateModel(request); tabId = AlibabaCloud.OpenApiUtil.Client.GetEncodeParam(tabId); Dictionary <string, object> body = new Dictionary <string, object>() { }; if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Footer)) { body["footer"] = request.Footer; } if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Icon)) { body["icon"] = request.Icon; } if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.ItemId)) { body["itemId"] = request.ItemId; } if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.MobileUrl)) { body["mobileUrl"] = request.MobileUrl; } if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.PcUrl)) { body["pcUrl"] = request.PcUrl; } if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Summary)) { body["summary"] = request.Summary; } if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Title)) { body["title"] = request.Title; } if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Url)) { body["url"] = request.Url; } Dictionary <string, string> realHeaders = new Dictionary <string, string>() { }; if (!AlibabaCloud.TeaUtil.Common.IsUnset(headers.CommonHeaders)) { realHeaders = headers.CommonHeaders; } if (!AlibabaCloud.TeaUtil.Common.IsUnset(headers.XAcsDingtalkAccessToken)) { realHeaders["x-acs-dingtalk-access-token"] = AlibabaCloud.TeaUtil.Common.ToJSONString(headers.XAcsDingtalkAccessToken); } AlibabaCloud.OpenApiClient.Models.OpenApiRequest req = new AlibabaCloud.OpenApiClient.Models.OpenApiRequest { Headers = realHeaders, Body = AlibabaCloud.OpenApiUtil.Client.ParseToMap(body), }; return(TeaModel.ToObject <InsertSearchItemResponse>(DoROARequest("InsertSearchItem", "search_1.0", "HTTP", "POST", "AK", "/v1.0/search/tabs/" + tabId + "/items", "none", req, runtime))); }
public async Task <InsertSearchItemResponse> InsertSearchItemAsync(string tabId, InsertSearchItemRequest request) { AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions(); InsertSearchItemHeaders headers = new InsertSearchItemHeaders(); return(await InsertSearchItemWithOptionsAsync(tabId, request, headers, runtime)); }