public static DescribeIntentResponse Unmarshall(UnmarshallerContext context) { DescribeIntentResponse describeIntentResponse = new DescribeIntentResponse(); describeIntentResponse.HttpResponse = context.HttpResponse; describeIntentResponse.RequestId = context.StringValue("DescribeIntent.RequestId"); describeIntentResponse.Success = context.BooleanValue("DescribeIntent.Success"); describeIntentResponse.Code = context.StringValue("DescribeIntent.Code"); describeIntentResponse.Message = context.StringValue("DescribeIntent.Message"); describeIntentResponse.HttpStatusCode = context.IntegerValue("DescribeIntent.HttpStatusCode"); DescribeIntentResponse.DescribeIntent_Intent intent = new DescribeIntentResponse.DescribeIntent_Intent(); intent.IntentId = context.StringValue("DescribeIntent.Intent.IntentId"); intent.ScriptId = context.StringValue("DescribeIntent.Intent.ScriptId"); intent.IntentName = context.StringValue("DescribeIntent.Intent.IntentName"); intent.IntentDescription = context.StringValue("DescribeIntent.Intent.IntentDescription"); intent.Utterances = context.StringValue("DescribeIntent.Intent.Utterances"); intent.Keywords = context.StringValue("DescribeIntent.Intent.Keywords"); intent.CreateTime = context.LongValue("DescribeIntent.Intent.CreateTime"); intent.UpdateTime = context.LongValue("DescribeIntent.Intent.UpdateTime"); describeIntentResponse.Intent = intent; return(describeIntentResponse); }
public static DescribeIntentResponse Unmarshall(UnmarshallerContext context) { DescribeIntentResponse describeIntentResponse = new DescribeIntentResponse(); describeIntentResponse.HttpResponse = context.HttpResponse; describeIntentResponse.RequestId = context.StringValue("DescribeIntent.RequestId"); describeIntentResponse.IntentId = context.LongValue("DescribeIntent.IntentId"); describeIntentResponse.Name = context.StringValue("DescribeIntent.Name"); describeIntentResponse.Type = context.StringValue("DescribeIntent.Type"); describeIntentResponse.DialogId = context.LongValue("DescribeIntent.DialogId"); describeIntentResponse.CreateTime = context.StringValue("DescribeIntent.CreateTime"); describeIntentResponse.ModifyTime = context.StringValue("DescribeIntent.ModifyTime"); describeIntentResponse.CreateUserId = context.StringValue("DescribeIntent.CreateUserId"); describeIntentResponse.CreateUserName = context.StringValue("DescribeIntent.CreateUserName"); describeIntentResponse.ModifyUserId = context.StringValue("DescribeIntent.ModifyUserId"); describeIntentResponse.ModifyUserName = context.StringValue("DescribeIntent.ModifyUserName"); List <DescribeIntentResponse.DescribeIntent_RuleCheckItem> describeIntentResponse_ruleCheck = new List <DescribeIntentResponse.DescribeIntent_RuleCheckItem>(); for (int i = 0; i < context.Length("DescribeIntent.RuleCheck.Length"); i++) { DescribeIntentResponse.DescribeIntent_RuleCheckItem ruleCheckItem = new DescribeIntentResponse.DescribeIntent_RuleCheckItem(); ruleCheckItem.Text = context.StringValue("DescribeIntent.RuleCheck[" + i + "].Text"); ruleCheckItem.Strict = context.BooleanValue("DescribeIntent.RuleCheck[" + i + "].Strict"); List <string> ruleCheckItem_warning = new List <string>(); for (int j = 0; j < context.Length("DescribeIntent.RuleCheck[" + i + "].Warning.Length"); j++) { ruleCheckItem_warning.Add(context.StringValue("DescribeIntent.RuleCheck[" + i + "].Warning[" + j + "]")); } ruleCheckItem.Warning = ruleCheckItem_warning; List <string> ruleCheckItem_error = new List <string>(); for (int j = 0; j < context.Length("DescribeIntent.RuleCheck[" + i + "].Error.Length"); j++) { ruleCheckItem_error.Add(context.StringValue("DescribeIntent.RuleCheck[" + i + "].Error[" + j + "]")); } ruleCheckItem.Error = ruleCheckItem_error; describeIntentResponse_ruleCheck.Add(ruleCheckItem); } describeIntentResponse.RuleCheck = describeIntentResponse_ruleCheck; List <DescribeIntentResponse.DescribeIntent_SlotItem> describeIntentResponse_slot = new List <DescribeIntentResponse.DescribeIntent_SlotItem>(); for (int i = 0; i < context.Length("DescribeIntent.Slot.Length"); i++) { DescribeIntentResponse.DescribeIntent_SlotItem slotItem = new DescribeIntentResponse.DescribeIntent_SlotItem(); slotItem.Name = context.StringValue("DescribeIntent.Slot[" + i + "].Name"); slotItem._Value = context.StringValue("DescribeIntent.Slot[" + i + "].Value"); slotItem.IsNecessary = context.BooleanValue("DescribeIntent.Slot[" + i + "].IsNecessary"); slotItem.IsArray = context.BooleanValue("DescribeIntent.Slot[" + i + "].IsArray"); slotItem.LifeSpan = context.IntegerValue("DescribeIntent.Slot[" + i + "].LifeSpan"); List <string> slotItem_question = new List <string>(); for (int j = 0; j < context.Length("DescribeIntent.Slot[" + i + "].Question.Length"); j++) { slotItem_question.Add(context.StringValue("DescribeIntent.Slot[" + i + "].Question[" + j + "]")); } slotItem.Question = slotItem_question; List <DescribeIntentResponse.DescribeIntent_SlotItem.DescribeIntent_TagsItem> slotItem_tags = new List <DescribeIntentResponse.DescribeIntent_SlotItem.DescribeIntent_TagsItem>(); for (int j = 0; j < context.Length("DescribeIntent.Slot[" + i + "].Tags.Length"); j++) { DescribeIntentResponse.DescribeIntent_SlotItem.DescribeIntent_TagsItem tagsItem = new DescribeIntentResponse.DescribeIntent_SlotItem.DescribeIntent_TagsItem(); tagsItem._Value = context.StringValue("DescribeIntent.Slot[" + i + "].Tags[" + j + "].Value"); tagsItem.UserSayId = context.StringValue("DescribeIntent.Slot[" + i + "].Tags[" + j + "].UserSayId"); slotItem_tags.Add(tagsItem); } slotItem.Tags = slotItem_tags; describeIntentResponse_slot.Add(slotItem); } describeIntentResponse.Slot = describeIntentResponse_slot; List <DescribeIntentResponse.DescribeIntent_UserSayItem> describeIntentResponse_userSay = new List <DescribeIntentResponse.DescribeIntent_UserSayItem>(); for (int i = 0; i < context.Length("DescribeIntent.UserSay.Length"); i++) { DescribeIntentResponse.DescribeIntent_UserSayItem userSayItem = new DescribeIntentResponse.DescribeIntent_UserSayItem(); userSayItem.Strict = context.BooleanValue("DescribeIntent.UserSay[" + i + "].Strict"); List <DescribeIntentResponse.DescribeIntent_UserSayItem.DescribeIntent_DataItem> userSayItem_data = new List <DescribeIntentResponse.DescribeIntent_UserSayItem.DescribeIntent_DataItem>(); for (int j = 0; j < context.Length("DescribeIntent.UserSay[" + i + "].Data.Length"); j++) { DescribeIntentResponse.DescribeIntent_UserSayItem.DescribeIntent_DataItem dataItem = new DescribeIntentResponse.DescribeIntent_UserSayItem.DescribeIntent_DataItem(); dataItem.Text = context.StringValue("DescribeIntent.UserSay[" + i + "].Data[" + j + "].Text"); dataItem.SlotId = context.StringValue("DescribeIntent.UserSay[" + i + "].Data[" + j + "].SlotId"); userSayItem_data.Add(dataItem); } userSayItem.Data = userSayItem_data; describeIntentResponse_userSay.Add(userSayItem); } describeIntentResponse.UserSay = describeIntentResponse_userSay; return(describeIntentResponse); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeIntentResponse response = new DescribeIntentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("botId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BotId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("botVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BotVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("creationDateTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDateTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("dialogCodeHook", targetDepth)) { var unmarshaller = DialogCodeHookSettingsUnmarshaller.Instance; response.DialogCodeHook = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("fulfillmentCodeHook", targetDepth)) { var unmarshaller = FulfillmentCodeHookSettingsUnmarshaller.Instance; response.FulfillmentCodeHook = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("inputContexts", targetDepth)) { var unmarshaller = new ListUnmarshaller <InputContext, InputContextUnmarshaller>(InputContextUnmarshaller.Instance); response.InputContexts = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("intentClosingSetting", targetDepth)) { var unmarshaller = IntentClosingSettingUnmarshaller.Instance; response.IntentClosingSetting = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("intentConfirmationSetting", targetDepth)) { var unmarshaller = IntentConfirmationSettingUnmarshaller.Instance; response.IntentConfirmationSetting = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("intentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("intentName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntentName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("kendraConfiguration", targetDepth)) { var unmarshaller = KendraConfigurationUnmarshaller.Instance; response.KendraConfiguration = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdatedDateTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastUpdatedDateTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("localeId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.LocaleId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("outputContexts", targetDepth)) { var unmarshaller = new ListUnmarshaller <OutputContext, OutputContextUnmarshaller>(OutputContextUnmarshaller.Instance); response.OutputContexts = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("parentIntentSignature", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ParentIntentSignature = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("sampleUtterances", targetDepth)) { var unmarshaller = new ListUnmarshaller <SampleUtterance, SampleUtteranceUnmarshaller>(SampleUtteranceUnmarshaller.Instance); response.SampleUtterances = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("slotPriorities", targetDepth)) { var unmarshaller = new ListUnmarshaller <SlotPriority, SlotPriorityUnmarshaller>(SlotPriorityUnmarshaller.Instance); response.SlotPriorities = unmarshaller.Unmarshall(context); continue; } } return(response); }