Fixes, added session class
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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
32
classlib/class/session.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
8
classlib/enum/authType.cs
Normal file
8
classlib/enum/authType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace PS.IPAM;
|
||||
using System;
|
||||
|
||||
[Serializable]
|
||||
public enum AuthType {
|
||||
credentials,
|
||||
token
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace PS.IPAM;
|
||||
using System;
|
||||
|
||||
[Serializable]
|
||||
public enum methods {
|
||||
GET,
|
||||
POST,
|
||||
PATCH,
|
||||
DELETE
|
||||
}
|
||||
Reference in New Issue
Block a user