コード例 #1
0
        internal static GetUpdatesResponse Parse(dynamic data)
        {
            if (data == null)
            {
                return null;
            }

            var getUpdatesResponse = new GetUpdatesResponse
            {
                Ok = data.ok,
                ErrorCode = data.error_code,
                Description = data.description,
                Result = new List<UpdateResponse>()
            };

            foreach (var result in data.result)
            {
                getUpdatesResponse.Result.Add(UpdateResponse.Parse(result));
            }

            return getUpdatesResponse;
        }
コード例 #2
0
        internal static GetUpdatesResponse Parse(JsonData data)
        {
            if (data == null)
            {
                return null;
            }

            var getUpdatesResponse = new GetUpdatesResponse
            {
                Ok = data.Get<bool>("ok"),
                ErrorCode = data.Get<int?>("error_code"),
                Description = data.Get<string>("description"),
                Result = new List<UpdateResponse>()
            };

            foreach (var result in data.GetJsonList("result"))
            {
                getUpdatesResponse.Result.Add(UpdateResponse.Parse(result));
            }

            return getUpdatesResponse;
        }
コード例 #3
0
        internal static GetUpdatesResponse Parse(JsonData data)
        {
            if (data == null)
            {
                return(null);
            }

            var getUpdatesResponse = new GetUpdatesResponse
            {
                Ok          = data.Get <bool>("ok"),
                ErrorCode   = data.Get <int?>("error_code"),
                Description = data.Get <string>("description"),
                Result      = new List <UpdateResponse>()
            };

            foreach (var result in data.GetJsonList("result"))
            {
                getUpdatesResponse.Result.Add(UpdateResponse.Parse(result));
            }

            return(getUpdatesResponse);
        }