public static UpdateRuleResponse Unmarshall(UnmarshallerContext context) { UpdateRuleResponse updateRuleResponse = new UpdateRuleResponse(); updateRuleResponse.HttpResponse = context.HttpResponse; updateRuleResponse.RequestId = context.StringValue("UpdateRule.RequestId"); updateRuleResponse.Success = context.BooleanValue("UpdateRule.Success"); updateRuleResponse.ErrorMessage = context.StringValue("UpdateRule.ErrorMessage"); return(updateRuleResponse); }
public static UpdateRuleResponse Unmarshall(UnmarshallerContext _ctx) { UpdateRuleResponse updateRuleResponse = new UpdateRuleResponse(); updateRuleResponse.HttpResponse = _ctx.HttpResponse; updateRuleResponse.RequestId = _ctx.StringValue("UpdateRule.RequestId"); updateRuleResponse.Success = _ctx.BooleanValue("UpdateRule.Success"); updateRuleResponse.Code = _ctx.StringValue("UpdateRule.Code"); updateRuleResponse.Message = _ctx.StringValue("UpdateRule.Message"); updateRuleResponse.Data = _ctx.StringValue("UpdateRule.Data"); return(updateRuleResponse); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { UpdateRuleResponse response = new UpdateRuleResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Identifier", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Identifier = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceTags", targetDepth)) { var unmarshaller = new ListUnmarshaller <ResourceTag, ResourceTagUnmarshaller>(ResourceTagUnmarshaller.Instance); response.ResourceTags = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RetentionPeriod", targetDepth)) { var unmarshaller = RetentionPeriodUnmarshaller.Instance; response.RetentionPeriod = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } } return(response); }
//更新规则的名称和描述 public void TestUpdateRule() { DefaultAcsClient acsClient = Demo.IotClient.GetClient(); long ruleId = 321103; UpdateRuleRequest request = new UpdateRuleRequest(); request.RuleId = ruleId; request.Name = "Rule_Test_082601"; request.ProductKey = "a163Bcy1oyR"; request.ShortTopic = "firstDevice/thing/event/property/post"; request.Select = " a, b, c"; request._Where = " a > 2"; request.RuleDesc = "This is a test."; UpdateRuleResponse response = acsClient.GetAcsResponse(request); Console.WriteLine("Update Rule: " + response.Success); if (!(bool)response.Success) { Console.WriteLine(response.Code + ", " + response.ErrorMessage); return; } GetRuleRequest request2 = new GetRuleRequest(); request2.RuleId = ruleId; GetRuleResponse response2 = acsClient.GetAcsResponse(request2); Console.WriteLine("Get Rule: " + response.Success); if (!(bool)response2.Success) { Console.WriteLine(response2.Code + ", " + response2.ErrorMessage); return; } GetRuleResponse.GetRule_RuleInfo RuleInfo = response2.RuleInfo; Console.WriteLine("Rule ID: " + RuleInfo.Id); Console.WriteLine("Rule Name: " + RuleInfo.Name); Console.WriteLine("Rule DataType: " + RuleInfo.DataType); Console.WriteLine("Rule ProductKey: " + RuleInfo.ProductKey); Console.WriteLine("Rule ShortTopic: " + RuleInfo.ShortTopic); Console.WriteLine("Rule Topic: " + RuleInfo.Topic); Console.WriteLine("Rule Select: " + RuleInfo.Select); Console.WriteLine("Rule Where: " + RuleInfo._Where); Console.WriteLine("Rule UtcCreated: " + RuleInfo.UtcCreated); }
public static UpdateRuleResponse Unmarshall(UnmarshallerContext _ctx) { UpdateRuleResponse updateRuleResponse = new UpdateRuleResponse(); updateRuleResponse.HttpResponse = _ctx.HttpResponse; updateRuleResponse.Code = _ctx.StringValue("UpdateRule.Code"); updateRuleResponse.Message = _ctx.StringValue("UpdateRule.Message"); updateRuleResponse.RequestId = _ctx.StringValue("UpdateRule.RequestId"); UpdateRuleResponse.UpdateRule_Data data = new UpdateRuleResponse.UpdateRule_Data(); data.Content = _ctx.StringValue("UpdateRule.Data.Content"); data.CreatedAt = _ctx.StringValue("UpdateRule.Data.CreatedAt"); data.Id = _ctx.StringValue("UpdateRule.Data.Id"); data.Name = _ctx.StringValue("UpdateRule.Data.Name"); updateRuleResponse.Data = data; return(updateRuleResponse); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { UpdateRuleResponse response = new UpdateRuleResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChangeToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ChangeToken = unmarshaller.Unmarshall(context); continue; } } return(response); }
//更新规则的名称和描述 public void TestSimpleUpdateRule() { DefaultAcsClient acsClient = Demo.IotClient.GetClient(); long ruleId = 321103; UpdateRuleRequest request = new UpdateRuleRequest(); request.RuleId = ruleId; request.Name = "Rule_Test_0826"; request.RuleDesc = "This is a test."; UpdateRuleResponse response = acsClient.GetAcsResponse(request); Console.WriteLine("Update Rule: " + response.Success); if (!(bool)response.Success) { Console.WriteLine(response.Code + ", " + response.ErrorMessage); return; } }