private static void addApplication(IoTDAClient client) { AddApplicationRequest req = new AddApplicationRequest { Body = new AddApplication() { AppName = "testApp3" }, }; try { var resp = client.AddApplication(req); Console.WriteLine(resp.HttpStatusCode); Console.WriteLine(JsonConvert.SerializeObject(resp)); } catch (RequestTimeoutException requestTimeoutException) { Console.WriteLine(requestTimeoutException.ErrorMessage); } catch (ServiceResponseException clientRequestException) { Console.WriteLine(clientRequestException.HttpStatusCode); Console.WriteLine(clientRequestException.ErrorCode); Console.WriteLine(clientRequestException.ErrorMsg); } catch (ConnectionException connectionException) { Console.WriteLine(connectionException.ErrorMessage); } }
/// <summary> /// 创建资源空间 /// </summary> public async Task <AddApplicationResponse> AddApplicationAsync(AddApplicationRequest addApplicationRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); string urlPath = HttpUtils.AddUrlPath("/v5/iot/{project_id}/apps", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, "application/json", addApplicationRequest); HttpResponseMessage response = await DoHttpRequestAsync("POST", request); return(JsonUtils.DeSerialize <AddApplicationResponse>(response)); }
public virtual string AddApplication(AddApplicationRequest request) { try { var result = LuisRepository.AddApplication(request); return(result); } catch (Exception ex) { Logger.Error("LuisService.AddApplication failed", this, ex); } return(null); }
public virtual string AddApplication(AddApplicationRequest request) { return(PolicyService.ExecuteRetryAndCapture400Errors( "LuisService.AddApplication", ApiKeys.LuisRetryInSeconds, () => { var result = LuisRepository.AddApplication(request); return result; }, null)); }
public AddApplicationResponse AddApplication(AddApplicationRequest request) { throw new NotImplementedException(); }
public AddApplicationResponse AddApplication(AddApplicationRequest request) { throw new NotImplementedException(); }