11namespace ReQuesty . Builder . CodeDOM ;
2+
23public enum CodePropertyKind
34{
45 Custom ,
56 RequestBuilder ,
67 AdditionalData ,
78 BackingStore ,
89 UrlTemplate ,
10+
911 /// <summary>
10- /// The set of parameters to be carried over to the next request builder.
12+ /// The set of parameters to be carried over to the next request builder.
1113 /// </summary>
1214 PathParameters ,
15+
1316 RequestAdapter ,
17+
1418 /// <summary>
15- /// The request body. Used when request parameters are wrapped in a class.
19+ /// The request body. Used when request parameters are wrapped in a class.
1620 /// </summary>
1721 RequestBody ,
22+
1823 /// <summary>
19- /// A request query parameter. Property of the query parameters class.
24+ /// A request query parameter. Property of the query parameters class.
2025 /// </summary>
2126 QueryParameter ,
27+
2228 /// <summary>
23- /// The request query parameters. Used when request parameters are wrapped in a class.
29+ /// The request query parameters. Used when request parameters are wrapped in a class.
2430 /// </summary>
2531 QueryParameters ,
32+
2633 /// <summary>
27- /// The request headers. Used when request parameters are wrapped in a class.
34+ /// The request headers. Used when request parameters are wrapped in a class.
2835 /// </summary>
2936 Headers ,
37+
3038 /// <summary>
31- /// The request middleware options. Used when request parameters are wrapped in a class.
39+ /// The request middleware options. Used when request parameters are wrapped in a class.
3240 /// </summary>
3341 Options ,
42+
3443 /// <summary>
35- /// The override for the error message for the error/exception type.
44+ /// The override for the error message for the error/exception type.
3645 /// </summary>
3746 ErrorMessageOverride
3847}
3948
4049public class CodeProperty : CodeTerminalWithKind < CodePropertyKind > , IDocumentedElement , IAlternativeName , ICloneable , IDeprecableElement , IAccessibleElement
4150{
42- public bool ReadOnly
43- {
44- get ; set ;
45- }
51+ public bool ReadOnly { get ; set ; }
52+
4653 public AccessModifier Access { get ; set ; } = AccessModifier . Public ;
54+
4755 public bool ExistsInBaseType => OriginalPropertyFromBaseType != null ;
48- public bool ExistsInExternalBaseType
49- {
50- get ; set ;
51- }
52- public CodeMethod ? Getter
53- {
54- get ; set ;
55- }
56- public CodeMethod ? Setter
57- {
58- get ; set ;
59- }
56+
57+ public bool ExistsInExternalBaseType { get ; set ; }
58+
59+ public CodeMethod ? Getter { get ; set ; }
60+
61+ public CodeMethod ? Setter { get ; set ; }
62+
6063 public CodeMethod ? GetterFromCurrentOrBaseType
6164 {
6265 get
@@ -74,6 +77,7 @@ public CodeMethod? GetterFromCurrentOrBaseType
7477 return default ;
7578 }
7679 }
80+
7781 public CodeMethod ? SetterFromCurrentOrBaseType
7882 {
7983 get
@@ -91,7 +95,8 @@ public CodeMethod? SetterFromCurrentOrBaseType
9195 return default ;
9296 }
9397 }
94- #nullable disable // the backing property is required
98+
99+ #nullable disable // the property is required
95100 private CodeTypeBase type ;
96101#nullable enable
97102 public required CodeTypeBase Type
@@ -103,28 +108,31 @@ public required CodeTypeBase Type
103108 type = value ;
104109 }
105110 }
111+
106112 public string DefaultValue { get ; set ; } = string . Empty ;
113+
107114 public CodeDocumentation Documentation { get ; set ; } = new ( ) ;
115+
108116 /// <inheritdoc/>
109117 public string SerializationName { get ; set ; } = string . Empty ;
118+
110119 public string NamePrefix { get ; set ; } = string . Empty ;
120+
111121 /// <inheritdoc/>
112122 public bool IsNameEscaped
113123 {
114124 get => ! string . IsNullOrEmpty ( SerializationName ) ;
115125 }
126+
116127 /// <inheritdoc/>
117128 public string WireName => IsNameEscaped ? SerializationName : Name ;
118- public CodeProperty ? OriginalPropertyFromBaseType
119- {
120- get ; set ;
121- }
122- public DeprecationInformation ? Deprecation
123- {
124- get ; set ;
125- }
129+
130+ public CodeProperty ? OriginalPropertyFromBaseType { get ; set ; }
131+
132+ public DeprecationInformation ? Deprecation { get ; set ; }
133+
126134 /// <summary>
127- /// Indicates if the property is the primary error message for the error/exception type.
135+ /// Indicates if the property is the primary error message for the error/exception type.
128136 /// </summary>
129137 public bool IsPrimaryErrorMessage
130138 {
@@ -150,8 +158,9 @@ public object Clone()
150158 NamePrefix = NamePrefix ,
151159 OriginalPropertyFromBaseType = OriginalPropertyFromBaseType ? . Clone ( ) as CodeProperty ,
152160 Deprecation = Deprecation ,
153- IsPrimaryErrorMessage = IsPrimaryErrorMessage ,
161+ IsPrimaryErrorMessage = IsPrimaryErrorMessage
154162 } ;
163+
155164 return property ;
156165 }
157166}
0 commit comments