Example #1
0
        public static ListDevicesResponse Unmarshall(UnmarshallerContext context)
        {
            ListDevicesResponse listDevicesResponse = new ListDevicesResponse();

            listDevicesResponse.HttpResponse = context.HttpResponse;
            listDevicesResponse.Code         = context.StringValue("ListDevices.Code");
            listDevicesResponse.Message      = context.StringValue("ListDevices.Message");
            listDevicesResponse.RequestId    = context.StringValue("ListDevices.RequestId");

            ListDevicesResponse.ListDevices_Data data = new ListDevicesResponse.ListDevices_Data();
            data.PageNumber = context.IntegerValue("ListDevices.Data.PageNumber");
            data.PageSize   = context.IntegerValue("ListDevices.Data.PageSize");
            data.TotalCount = context.IntegerValue("ListDevices.Data.TotalCount");
            data.TotalPage  = context.IntegerValue("ListDevices.Data.TotalPage");

            List <ListDevicesResponse.ListDevices_Data.ListDevices_Record> data_records = new List <ListDevicesResponse.ListDevices_Data.ListDevices_Record>();

            for (int i = 0; i < context.Length("ListDevices.Data.Records.Length"); i++)
            {
                ListDevicesResponse.ListDevices_Data.ListDevices_Record record = new ListDevicesResponse.ListDevices_Data.ListDevices_Record();
                record.AccessProtocolType = context.StringValue("ListDevices.Data.Records[" + i + "].AccessProtocolType");
                record.BitRate            = context.StringValue("ListDevices.Data.Records[" + i + "].BitRate");
                record.CoverImageUrl      = context.StringValue("ListDevices.Data.Records[" + i + "].CoverImageUrl");
                record.GBid            = context.StringValue("ListDevices.Data.Records[" + i + "].GBid");
                record.DeviceAddress   = context.StringValue("ListDevices.Data.Records[" + i + "].DeviceAddress");
                record.DeviceDirection = context.StringValue("ListDevices.Data.Records[" + i + "].DeviceDirection");
                record.DeviceSite      = context.StringValue("ListDevices.Data.Records[" + i + "].DeviceSite");
                record.Latitude        = context.StringValue("ListDevices.Data.Records[" + i + "].Latitude");
                record.Longitude       = context.StringValue("ListDevices.Data.Records[" + i + "].Longitude");
                record.DeviceName      = context.StringValue("ListDevices.Data.Records[" + i + "].DeviceName");
                record.Resolution      = context.StringValue("ListDevices.Data.Records[" + i + "].Resolution");
                record.SipGBId         = context.StringValue("ListDevices.Data.Records[" + i + "].SipGBId");
                record.SipPassword     = context.StringValue("ListDevices.Data.Records[" + i + "].SipPassword");
                record.SipServerIp     = context.StringValue("ListDevices.Data.Records[" + i + "].SipServerIp");
                record.SipServerPort   = context.StringValue("ListDevices.Data.Records[" + i + "].SipServerPort");
                record.Status          = context.IntegerValue("ListDevices.Data.Records[" + i + "].Status");
                record.DeviceType      = context.StringValue("ListDevices.Data.Records[" + i + "].DeviceType");
                record.Vendor          = context.StringValue("ListDevices.Data.Records[" + i + "].Vendor");
                record.CreateTime      = context.StringValue("ListDevices.Data.Records[" + i + "].CreateTime");

                data_records.Add(record);
            }
            data.Records             = data_records;
            listDevicesResponse.Data = data;

            return(listDevicesResponse);
        }
        public static ListDevicesResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListDevicesResponse listDevicesResponse = new ListDevicesResponse();

            listDevicesResponse.HttpResponse = _ctx.HttpResponse;
            listDevicesResponse.ErrorCode    = _ctx.IntegerValue("ListDevices.ErrorCode");
            listDevicesResponse.Message      = _ctx.StringValue("ListDevices.Message");
            listDevicesResponse.Success      = _ctx.BooleanValue("ListDevices.Success");
            listDevicesResponse.RequestId    = _ctx.StringValue("ListDevices.RequestId");

            ListDevicesResponse.ListDevices_Data data = new ListDevicesResponse.ListDevices_Data();
            data.Total      = _ctx.IntegerValue("ListDevices.Data.Total");
            data.PageSize   = _ctx.IntegerValue("ListDevices.Data.PageSize");
            data.PageNumber = _ctx.IntegerValue("ListDevices.Data.PageNumber");

            List <ListDevicesResponse.ListDevices_Data.ListDevices_Device> data_devices = new List <ListDevicesResponse.ListDevices_Data.ListDevices_Device>();

            for (int i = 0; i < _ctx.Length("ListDevices.Data.Devices.Length"); i++)
            {
                ListDevicesResponse.ListDevices_Data.ListDevices_Device device = new ListDevicesResponse.ListDevices_Data.ListDevices_Device();
                device.ActivationCode = _ctx.StringValue("ListDevices.Data.Devices[" + i + "].ActivationCode");
                device.ConferenceCode = _ctx.StringValue("ListDevices.Data.Devices[" + i + "].ConferenceCode");
                device.ConferenceName = _ctx.StringValue("ListDevices.Data.Devices[" + i + "].ConferenceName");
                device.CreateTime     = _ctx.StringValue("ListDevices.Data.Devices[" + i + "].CreateTime");
                device.PictureUrl     = _ctx.StringValue("ListDevices.Data.Devices[" + i + "].PictureUrl");
                device.SN             = _ctx.StringValue("ListDevices.Data.Devices[" + i + "].SN");
                device.Status         = _ctx.StringValue("ListDevices.Data.Devices[" + i + "].Status");
                device.CastScreenCode = _ctx.StringValue("ListDevices.Data.Devices[" + i + "].CastScreenCode");

                data_devices.Add(device);
            }
            data.Devices             = data_devices;
            listDevicesResponse.Data = data;

            return(listDevicesResponse);
        }