6
6
using ApiGenerator . Domain . Code . HighLevel . Requests ;
7
7
using ApiGenerator . Domain . Code . LowLevel ;
8
8
using Newtonsoft . Json ;
9
+ using Newtonsoft . Json . Converters ;
9
10
10
11
namespace ApiGenerator . Domain . Specification
11
12
{
12
13
public class ApiEndpoint
13
14
{
14
15
/// <summary> The filename of the spec describing the api endpoint </summary>
15
16
public string FileName { get ; set ; }
16
-
17
+
17
18
/// <summary> The original name as declared in the spec </summary>
18
19
public string Name { get ; set ; }
19
-
20
+
20
21
/// <summary> The original namespace as declared in the spec </summary>
21
22
public string Namespace { get ; set ; }
22
-
23
+
23
24
/// <summary> The original method name as declared in the spec </summary>
24
25
public string MethodName { get ; set ; }
25
-
26
+
26
27
/// <summary> Computed Csharp identifier names </summary>
27
- public CsharpNames CsharpNames { get ; set ; }
28
-
28
+ public CsharpNames CsharpNames { get ; set ; }
29
+
30
+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
31
+ [ JsonProperty ( "stability" ) ]
32
+ public Stability Stability { get ; set ; }
33
+
29
34
[ JsonProperty ( "documentation" ) ]
30
35
public string OfficialDocumentationLink { get ; set ; }
31
-
36
+
32
37
public UrlInformation Url { get ; set ; }
33
-
38
+
34
39
public Body Body { get ; set ; }
35
40
36
41
[ JsonProperty ( "methods" ) ]
37
42
public IReadOnlyCollection < string > HttpMethods { get ; set ; }
38
-
43
+
39
44
public IEndpointOverrides Overrides { get ; internal set ; }
40
45
41
46
public RequestInterface RequestInterface => new RequestInterface
@@ -45,30 +50,31 @@ public class ApiEndpoint
45
50
PartialParameters = Body == null ? Enumerable . Empty < QueryParameters > ( ) . ToList ( ) : Url . Params . Values . Where ( p=> p . RenderPartial && ! p . Skip ) . ToList ( ) ,
46
51
OfficialDocumentationLink = OfficialDocumentationLink
47
52
} ;
48
-
53
+
49
54
public RequestPartialImplementation RequestPartialImplementation => new RequestPartialImplementation
50
55
{
51
56
CsharpNames = CsharpNames ,
52
57
OfficialDocumentationLink = OfficialDocumentationLink ,
58
+ Stability = Stability ,
53
59
Paths = Url . Paths ,
54
60
Parts = Url . Parts ,
55
61
Params = Url . Params . Values . Where ( p=> ! p . Skip ) . ToList ( ) ,
56
62
Constructors = Constructor . RequestConstructors ( CsharpNames , Url , inheritsFromPlainRequestBase : true ) . ToList ( ) ,
57
63
GenericConstructors = Constructor . RequestConstructors ( CsharpNames , Url , inheritsFromPlainRequestBase : false ) . ToList ( ) ,
58
64
HasBody = Body != null ,
59
65
} ;
60
-
66
+
61
67
public DescriptorPartialImplementation DescriptorPartialImplementation => new DescriptorPartialImplementation
62
68
{
63
- CsharpNames = CsharpNames ,
69
+ CsharpNames = CsharpNames ,
64
70
OfficialDocumentationLink = OfficialDocumentationLink ,
65
71
Constructors = Constructor . DescriptorConstructors ( CsharpNames , Url ) . ToList ( ) ,
66
72
Paths = Url . Paths ,
67
73
Parts = Url . Parts ,
68
74
Params = Url . Params . Values . Where ( p=> ! p . Skip ) . ToList ( ) ,
69
75
HasBody = Body != null ,
70
76
} ;
71
-
77
+
72
78
public RequestParameterImplementation RequestParameterImplementation => new RequestParameterImplementation
73
79
{
74
80
CsharpNames = CsharpNames ,
@@ -89,7 +95,7 @@ public string PreferredHttpMethod
89
95
}
90
96
91
97
public string HighLevelMethodXmlDocDescription => $ "<c>{ PreferredHttpMethod } </c> request to the <c>{ Name } </c> API, read more about this API online:";
92
-
98
+
93
99
public HighLevelModel HighLevelModel => new HighLevelModel
94
100
{
95
101
CsharpNames = CsharpNames ,
@@ -132,15 +138,16 @@ public IReadOnlyCollection<LowLevelClientMethod> LowLevelClientMethods
132
138
. Select ( p => p . Argument )
133
139
. Concat ( new [ ] { CsharpNames . ParametersName + " requestParameters = null" } )
134
140
. ToList ( ) ;
135
-
141
+
136
142
var apiMethod = new LowLevelClientMethod
137
143
{
138
144
Arguments = string . Join ( ", " , args ) ,
139
145
CsharpNames = CsharpNames ,
140
146
PerPathMethodName = methodName ,
141
147
HttpMethod = httpMethod ,
142
148
OfficialDocumentationLink = OfficialDocumentationLink ,
143
- DeprecatedPath = path . Deprecation ,
149
+ Stability = Stability ,
150
+ DeprecatedPath = path . Deprecation ,
144
151
Path = path . Path ,
145
152
Parts = parts ,
146
153
Url = Url ,
0 commit comments