Refactor IPAM model classes to use records for Address, Subnetwork, Vlan, Vrf, Section, Tag, Domain, Nameserver, and Session; enhance documentation and implement value equality for records.
This commit is contained in:
@@ -1,35 +1,21 @@
|
||||
namespace PS.IPAM;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a VRF (Virtual Routing and Forwarding) instance in phpIPAM.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class Vrf {
|
||||
public int Id { get; }
|
||||
public string Name { get; }
|
||||
public string RouteDistinguisher { get; }
|
||||
public string Description { get; }
|
||||
public string Sections { get; }
|
||||
public DateTime? EditDate { get; }
|
||||
public Object? ExtendedData { get; }
|
||||
|
||||
public Vrf(
|
||||
int id,
|
||||
string name,
|
||||
string rd,
|
||||
string description,
|
||||
string sections,
|
||||
DateTime? editDate,
|
||||
Object? custom_fields
|
||||
) {
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
this.RouteDistinguisher = rd;
|
||||
this.Description = description;
|
||||
this.Sections = sections;
|
||||
this.EditDate = editDate;
|
||||
this.ExtendedData = custom_fields;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
}
|
||||
public sealed record Vrf(
|
||||
int Id,
|
||||
string Name,
|
||||
string RouteDistinguisher,
|
||||
string Description,
|
||||
string Sections,
|
||||
DateTime? EditDate,
|
||||
Dictionary<string, object>? ExtendedData = null
|
||||
)
|
||||
{
|
||||
public override string ToString() => Name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user