| | 1 | | using System.ComponentModel.DataAnnotations; |
| | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | 3 | | using Microsoft.EntityFrameworkCore; |
| | 4 | |
|
| | 5 | | namespace LGDXRobotCloud.Data.Entities; |
| | 6 | |
|
| | 7 | | [Table("Automation.Triggers")] |
| | 8 | | [Index(nameof(ApiKeyInsertLocationId))] |
| | 9 | | public class Trigger |
| | 10 | | { |
| | 11 | | [Key] |
| | 12 | | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
| 0 | 13 | | public int Id { get; set; } |
| | 14 | |
|
| | 15 | | [MaxLength(50)] |
| | 16 | | [Required] |
| 0 | 17 | | public string Name { get; set; } = null!; |
| | 18 | |
|
| | 19 | | [MaxLength(200)] |
| | 20 | | [Required] |
| 0 | 21 | | public string Url { get; set; } = null!; |
| | 22 | |
|
| 0 | 23 | | public int HttpMethodId { get; set; } |
| | 24 | |
|
| 0 | 25 | | public string? Body { get; set; } |
| | 26 | |
|
| 0 | 27 | | public bool SkipOnFailure { get; set; } |
| | 28 | |
|
| 0 | 29 | | public int? ApiKeyInsertLocationId { get; set; } |
| | 30 | |
|
| | 31 | | [MaxLength(50)] |
| 0 | 32 | | public string? ApiKeyFieldName { get; set; } // Header name or Json name |
| | 33 | |
|
| | 34 | | [ForeignKey("ApiKeyId")] |
| 0 | 35 | | public ApiKey? ApiKey { get; set; } |
| | 36 | |
|
| 0 | 37 | | public int? ApiKeyId { get; set; } |
| | 38 | | } |