Skip to content
Snippets Groups Projects
AddSectorResponseContract.cs 2.11 KiB
Newer Older
Michal Ondrejička's avatar
Michal Ondrejička committed
using SDK.Communication;
using SDK.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SDK.Contracts.Communication
{
    class AddSectorResponseContract : PostResponseContract
    {
        public int Id { get; set; }

Michal Ondrejička's avatar
Michal Ondrejička committed
        public Guid Guid { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

        public int BranchId { get; set; }

        public string Title { get; set; }

        public double BarrierWidth { get; set; }

        public double BarrierHeight { get; set; }

        public double SectorWidth { get; set; }

        public double SectorHeight { get; set; }

        public long Modified { get; set; }

        public string Configuration { get; set; }

Michal Ondrejička's avatar
Michal Ondrejička committed
        public GpsItemContract[]? GpsItems { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed
        public AreaContract[]? Areas { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed
        public BarrierContract[]? Barriers { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed
        public BeaconContract[]? Beacons { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed
        public SensorContract[]? Sensors { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

        public static explicit operator SectorContract(AddSectorResponseContract addSectorResponseContract)
        {
            return new SectorContract
            {
                Id = addSectorResponseContract.Id,
                Guid = addSectorResponseContract.Guid,
                BranchId = addSectorResponseContract.BranchId,
                Title = addSectorResponseContract.Title,
                BarrierHeight = addSectorResponseContract.BarrierHeight,
                BarrierWidth = addSectorResponseContract.BarrierWidth,
                SectorWidth = addSectorResponseContract.SectorWidth,
                SectorHeight = addSectorResponseContract.SectorHeight,
                Modified = addSectorResponseContract.Modified,
                Configuration = addSectorResponseContract.Configuration,
Michal Ondrejička's avatar
Michal Ondrejička committed
                GpsItems = addSectorResponseContract.GpsItems,
                Areas = addSectorResponseContract.Areas,
                Barriers = addSectorResponseContract.Barriers,
                Beacons = addSectorResponseContract.Beacons,
                Sensors = addSectorResponseContract.Sensors
            };
        }
    }
}