using System.Text.Json.Serialization; namespace NetBoxWindowsAgent; internal sealed class AgentConfig { [JsonPropertyName("netbox_url")] public string NetBoxUrl { get; set; } = ""; [JsonPropertyName("api_token")] public string ApiToken { get; set; } = ""; [JsonPropertyName("region")] public string Region { get; set; } = ""; [JsonPropertyName("site")] public string? Site { get; set; } [JsonPropertyName("location")] public string? Location { get; set; } [JsonPropertyName("device_role")] public string DeviceRole { get; set; } = "windows-client"; [JsonPropertyName("verify_tls")] public bool VerifyTls { get; set; } = true; [JsonPropertyName("allow_insecure_tls")] public bool AllowInsecureTls { get; set; } = false; [JsonPropertyName("timeout_seconds")] public int TimeoutSeconds { get; set; } = 30; [JsonPropertyName("collect_software")] public bool CollectSoftware { get; set; } = true; [JsonPropertyName("max_software_entries")] public int MaxSoftwareEntries { get; set; } = 250; [JsonPropertyName("create_hardware_modules")] public bool CreateHardwareModules { get; set; } = true; [JsonPropertyName("create_interfaces")] public bool CreateInterfaces { get; set; } = true; [JsonPropertyName("tags")] public List Tags { get; set; } = []; [JsonPropertyName("custom_fields")] public Dictionary CustomFields { get; set; } = new(); } internal sealed record HardwareInfo( string Hostname, string Manufacturer, string Model, string Serial, string Uuid, string WindowsCaption, string WindowsVersion, string Architecture, string Processor, ulong MemoryBytes, IReadOnlyList Disks, IReadOnlyList Networks, IReadOnlyList MemoryModules, IReadOnlyList Software); internal sealed record DiskInfo(string DeviceId, string Model, string Serial, ulong SizeBytes); internal sealed record NetworkInfo(string Name, string MacAddress, IReadOnlyList IpAddresses); internal sealed record MemoryInfo(string Bank, string Manufacturer, string PartNumber, string Serial, ulong CapacityBytes); internal sealed record SoftwareInfo(string Name, string Version, string Publisher); internal sealed class Page { [JsonPropertyName("count")] public int Count { get; set; } [JsonPropertyName("results")] public List Results { get; set; } = []; } internal sealed class NetBoxObject { [JsonPropertyName("id")] public int Id { get; set; } [JsonPropertyName("name")] public string? Name { get; set; } [JsonPropertyName("slug")] public string? Slug { get; set; } [JsonPropertyName("serial")] public string? Serial { get; set; } }