コード例 #1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ListIntentsResponse response = new ListIntentsResponse();

            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("intentSummaries", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <IntentSummary, IntentSummaryUnmarshaller>(IntentSummaryUnmarshaller.Instance);
                    response.IntentSummaries = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("localeId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.LocaleId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("nextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
コード例 #2
0
        public static ListIntentsResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListIntentsResponse listIntentsResponse = new ListIntentsResponse();

            listIntentsResponse.HttpResponse   = _ctx.HttpResponse;
            listIntentsResponse.Code           = _ctx.StringValue("ListIntents.Code");
            listIntentsResponse.HttpStatusCode = _ctx.IntegerValue("ListIntents.HttpStatusCode");
            listIntentsResponse.Message        = _ctx.StringValue("ListIntents.Message");
            listIntentsResponse.RequestId      = _ctx.StringValue("ListIntents.RequestId");
            listIntentsResponse.Success        = _ctx.BooleanValue("ListIntents.Success");

            ListIntentsResponse.ListIntents_Intents intents = new ListIntentsResponse.ListIntents_Intents();
            intents.PageNumber = _ctx.IntegerValue("ListIntents.Intents.PageNumber");
            intents.PageSize   = _ctx.IntegerValue("ListIntents.Intents.PageSize");
            intents.TotalCount = _ctx.IntegerValue("ListIntents.Intents.TotalCount");

            List <ListIntentsResponse.ListIntents_Intents.ListIntents_Intent> intents_list = new List <ListIntentsResponse.ListIntents_Intents.ListIntents_Intent>();

            for (int i = 0; i < _ctx.Length("ListIntents.Intents.List.Length"); i++)
            {
                ListIntentsResponse.ListIntents_Intents.ListIntents_Intent intent = new ListIntentsResponse.ListIntents_Intents.ListIntents_Intent();
                intent.CreateTime        = _ctx.LongValue("ListIntents.Intents.List[" + i + "].CreateTime");
                intent.IntentDescription = _ctx.StringValue("ListIntents.Intents.List[" + i + "].IntentDescription");
                intent.IntentId          = _ctx.StringValue("ListIntents.Intents.List[" + i + "].IntentId");
                intent.IntentName        = _ctx.StringValue("ListIntents.Intents.List[" + i + "].IntentName");
                intent.Keywords          = _ctx.StringValue("ListIntents.Intents.List[" + i + "].Keywords");
                intent.ScriptId          = _ctx.StringValue("ListIntents.Intents.List[" + i + "].ScriptId");
                intent.UpdateTime        = _ctx.LongValue("ListIntents.Intents.List[" + i + "].UpdateTime");
                intent.Utterances        = _ctx.StringValue("ListIntents.Intents.List[" + i + "].Utterances");

                intents_list.Add(intent);
            }
            intents.List = intents_list;
            listIntentsResponse.Intents = intents;

            return(listIntentsResponse);
        }