/// <summary> /// 更新公网NAT网关 /// </summary> public UpdateNatGatewayResponse UpdateNatGateway(UpdateNatGatewayRequest updateNatGatewayRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); urlParam.Add("nat_gateway_id", updateNatGatewayRequest.NatGatewayId.ToString()); string urlPath = HttpUtils.AddUrlPath("/v2/{project_id}/nat_gateways/{nat_gateway_id}", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, "application/json", updateNatGatewayRequest); HttpResponseMessage response = DoHttpRequestSync("PUT", request); return(JsonUtils.DeSerialize <UpdateNatGatewayResponse>(response)); }
protected override void ProcessRecord() { base.ProcessRecord(); UpdateNatGatewayRequest request; try { request = new UpdateNatGatewayRequest { NatGatewayId = NatGatewayId, UpdateNatGatewayDetails = UpdateNatGatewayDetails, IfMatch = IfMatch }; response = client.UpdateNatGateway(request).GetAwaiter().GetResult(); WriteOutput(response, response.NatGateway); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }