Fixes, added session class

This commit is contained in:
2022-12-12 13:08:04 +03:00
parent 7d0d1b53ae
commit 5a34f03779
22 changed files with 193 additions and 225 deletions

View File

@@ -23,6 +23,7 @@ public class Address {
public string FirewallAddressObject { get; }
public DateTime? EditDate { get; }
public int CustomerId { get; }
public Object? ExtendedData { get; }
public Address(
int id,
@@ -44,7 +45,8 @@ public class Address {
int PTR,
string firewallAddressObject,
DateTime? editDate,
int customer_id
int customer_id,
Object? extendedData
) {
this.Id = id;
this.SubnetId = subnetId;
@@ -66,6 +68,7 @@ public class Address {
this.FirewallAddressObject = firewallAddressObject;
this.EditDate = editDate;
this.CustomerId = customer_id;
this.ExtendedData = extendedData;
}
public override string ToString() {

View File

@@ -12,6 +12,7 @@ public class Section {
public string SubnetOrdering { get; }
public int Order { get; }
public DateTime? EditDate { get; }
public bool ShowSubnet { get; }
public bool ShowVlan { get; }
public bool ShowVRF { get; }
public bool ShowSupernetOnly { get; }
@@ -27,6 +28,7 @@ public class Section {
string subnetOrdering,
int order,
DateTime? editDate,
bool showSubnet,
bool showVlan,
bool showVRF,
bool showSupernetOnly,
@@ -41,6 +43,7 @@ public class Section {
this.SubnetOrdering = subnetOrdering;
this.Order = order;
this.EditDate = editDate;
this.ShowSubnet = showSubnet;
this.ShowVlan = showVlan;
this.ShowVRF = showVRF;
this.ShowSupernetOnly = showSupernetOnly;

32
classlib/class/session.cs Normal file
View File

@@ -0,0 +1,32 @@
namespace PS.IPAM;
using System;
[Serializable]
public class Session {
public AuthType AuthType { get; }
public string Token { get; }
public string AppID { get; }
public string URL { get; }
public DateTime? Expires { get; }
public Object? Credentials { get; }
public Session(
AuthType authType,
string token,
string appId,
string url,
DateTime? expires,
Object? credentials
) {
AuthType = authType;
Token = token;
AppID = appId;
URL = url;
Expires = expires;
Credentials = credentials;
}
public override string ToString()
{
return base.ToString();
}
}

View File

@@ -9,6 +9,7 @@ public class Vrf {
public string Description { get; }
public string Sections { get; }
public DateTime? EditDate { get; }
public Object? ExtendedData { get; }
public Vrf(
int id,
@@ -16,7 +17,8 @@ public class Vrf {
string rd,
string description,
string sections,
DateTime? editDate
DateTime? editDate,
Object? custom_fields
) {
this.Id = id;
this.Name = name;
@@ -24,6 +26,7 @@ public class Vrf {
this.Description = description;
this.Sections = sections;
this.EditDate = editDate;
this.ExtendedData = custom_fields;
}
public override string ToString()
{

View File

@@ -0,0 +1,8 @@
namespace PS.IPAM;
using System;
[Serializable]
public enum AuthType {
credentials,
token
}

View File

@@ -1,10 +0,0 @@
namespace PS.IPAM;
using System;
[Serializable]
public enum methods {
GET,
POST,
PATCH,
DELETE
}