mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 09:41:19 +00:00
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using MyCore.DTO.Common;
|
|
using MyCore.DTO.MyControlPanel;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace MyCore.Models.MyControlPanel
|
|
{
|
|
/// <summary>
|
|
/// Provider of a device (provider of informations) - e.g. : Meross, Arlo, IoThomas, ...
|
|
/// </summary>
|
|
public class Provider
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(BsonType.ObjectId)]
|
|
public string Id { get; set; }
|
|
|
|
[BsonElement("Name")]
|
|
[BsonRequired]
|
|
public string Name { get; set; }
|
|
|
|
[BsonElement("Username")]
|
|
[BsonRequired]
|
|
public string Username { get; set; }
|
|
|
|
[BsonElement("Password")]
|
|
[BsonRequired]
|
|
public string Password { get; set; } // TODO ENCRYPTED
|
|
|
|
[BsonElement("ApiKey")]
|
|
public string ApiKey { get; set; } // TODO ENCRYPTED
|
|
|
|
public ProviderDTO ToDTO()
|
|
{
|
|
return new ProviderDTO()
|
|
{
|
|
Id = Id,
|
|
Name = Name
|
|
};
|
|
}
|
|
}
|
|
}
|