Skip to content
Snippets Groups Projects
AddBeaconResponseContract.cs 2.37 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
{
    public class AddBeaconResponseContract : PostResponseContract
    {
        public int Id { get; set; }

Michal Ondrejička's avatar
Michal Ondrejička committed
        public int? SectorId { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

        public int BranchId { get; set; }

        public string Mac { get; set; }

Michal Ondrejička's avatar
Michal Ondrejička committed
        public double? X { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

Michal Ondrejička's avatar
Michal Ondrejička committed
        public double? Y { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

Michal Ondrejička's avatar
Michal Ondrejička committed
        public double? Z { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

        public string Title { get; set; }

        public bool Active { get; set; }

        public bool Position { get; set; }

Michal Ondrejička's avatar
Michal Ondrejička committed
        public int? TypeId { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

        public bool Geofence { get; set; }

Michal Ondrejička's avatar
Michal Ondrejička committed
        public double? GeofenceRange { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

        public string Cluster { get; set; }

Michal Ondrejička's avatar
Michal Ondrejička committed
        public long? LastTimeOnline { get; set; }
Michal Ondrejička's avatar
Michal Ondrejička committed

        public bool UseGps { get; set; }

        public string CFUUID { get; set; }

        public long Created { get; set; }

        public long Update { get; set; }

        public static explicit operator BeaconContract (AddBeaconResponseContract addBeaconResponseContract)
        {
            return new BeaconContract
            {
                Id = addBeaconResponseContract.Id,
                SectorId = addBeaconResponseContract.SectorId,
                BranchId = addBeaconResponseContract.BranchId,
                Mac = addBeaconResponseContract.Mac,
                X = addBeaconResponseContract.X,
                Y = addBeaconResponseContract.Y,
                Z = addBeaconResponseContract.Z,
                Title = addBeaconResponseContract.Title,
                Active = addBeaconResponseContract.Active,
                Position = addBeaconResponseContract.Position,
                TypeId = addBeaconResponseContract.TypeId,
                Geofence = addBeaconResponseContract.Geofence,
                GeofenceRange = addBeaconResponseContract.GeofenceRange,
                Cluster = addBeaconResponseContract.Cluster,
                LastTimeOnline = addBeaconResponseContract.LastTimeOnline,
                UseGps = addBeaconResponseContract.UseGps,
                CFUUID = addBeaconResponseContract.CFUUID,
                Created = addBeaconResponseContract.Created,
                Update = addBeaconResponseContract.Update,
            };
        }
    }
}