This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDtos.cs
159 lines (128 loc) · 3.48 KB
/
Dtos.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
using System.Collections.Generic;
using Newtonsoft.Json;
namespace vault;
public record SpaceDto(string CreateTime, string Id, string UpdateTime, string Description);
public record NotAuthorizedDto(string message, string details);
public record InternalErrorDto(string message, string rayID);
public record SuccessActionDto(string update_time);
public record ClearedStatusDto(string traceId, int status);
public class Idp
{
[JsonConstructor]
public Idp(
[JsonProperty("id")] string id,
[JsonProperty("type")] string type
)
{
this.Id = id;
this.Type = type;
}
[JsonProperty("id")]
public readonly string Id;
[JsonProperty("type")]
public readonly string Type;
}
public class Geo
{
[JsonConstructor]
public Geo(
[JsonProperty("country")] string country
)
{
this.Country = country;
}
[JsonProperty("country")]
public readonly string Country;
}
public class Org
{
[JsonConstructor]
public Org(
[JsonProperty("id")] int id,
[JsonProperty("name")] string name
)
{
this.Id = id;
this.Name = name;
}
[JsonProperty("id")]
public readonly int Id;
[JsonProperty("name")]
public readonly string Name;
}
public class Team
{
[JsonConstructor]
public Team(
[JsonProperty("name")] string name,
[JsonProperty("org_id")] int orgId
)
{
this.Name = name;
this.OrgId = orgId;
}
[JsonProperty("name")]
public readonly string Name;
[JsonProperty("org_id")]
public readonly int OrgId;
}
public class CloudflareIdentityDto
{
[JsonConstructor]
public CloudflareIdentityDto(
[JsonProperty("id")] int id,
[JsonProperty("name")] string name,
[JsonProperty("email")] string email,
[JsonProperty("idp")] Idp idp,
[JsonProperty("geo")] Geo geo,
[JsonProperty("user_uuid")] string userUuid,
[JsonProperty("account_id")] string accountId,
[JsonProperty("ip")] string ip,
[JsonProperty("auth_status")] string authStatus,
[JsonProperty("common_name")] string commonName,
[JsonProperty("version")] int version,
[JsonProperty("orgs")] List<Org> orgs,
[JsonProperty("teams")] List<Team> teams
)
{
this.Id = id;
this.Name = name;
this.Email = email;
this.Idp = idp;
this.Geo = geo;
this.UserUuid = userUuid;
this.AccountId = accountId;
this.Ip = ip;
this.AuthStatus = authStatus;
this.CommonName = commonName;
this.Version = version;
this.Orgs = orgs;
this.Teams = teams;
}
[JsonProperty("id")]
public readonly int Id;
[JsonProperty("name")]
public readonly string Name;
[JsonProperty("email")]
public readonly string Email;
[JsonProperty("idp")]
public readonly Idp Idp;
[JsonProperty("geo")]
public readonly Geo Geo;
[JsonProperty("user_uuid")]
public readonly string UserUuid;
[JsonProperty("account_id")]
public readonly string AccountId;
[JsonProperty("ip")]
public readonly string Ip;
[JsonProperty("auth_status")]
public readonly string AuthStatus;
[JsonProperty("common_name")]
public readonly string CommonName;
[JsonProperty("version")]
public readonly int Version;
[JsonProperty("orgs")]
public readonly List<Org> Orgs;
[JsonProperty("teams")]
public readonly List<Team> Teams;
}