@@ -19,6 +19,7 @@ public class ApiClient
1919{
2020 public ApiClient ( HttpClient client )
2121 {
22+ InheritingButDifferentType = new InheritingButDifferentTypeClient ( client ) ;
2223 InheritingTwo = new InheritingTwoClient ( client ) ;
2324 InheritingUser2 = new InheritingUser2Client ( client ) ;
2425 NonApi = new NonApiClient ( client ) ;
@@ -28,6 +29,7 @@ public ApiClient(HttpClient client)
2829 YetAnother = new YetAnotherClient ( client ) ;
2930 }
3031
32+ public InheritingButDifferentTypeClient InheritingButDifferentType { get ; }
3133 public InheritingTwoClient InheritingTwo { get ; }
3234 public InheritingUser2Client InheritingUser2 { get ; }
3335 public NonApiClient NonApi { get ; }
@@ -123,6 +125,191 @@ public bool TryGetSuccessData([NotNullWhen(true)] out Task<T?> data)
123125 }
124126}
125127
128+ public class InheritingButDifferentTypeClient
129+ {
130+ private readonly HttpClient _client ;
131+ public InheritingButDifferentTypeClient ( HttpClient client )
132+ {
133+ _client = client ;
134+ }
135+
136+ public async Task < Response < int > > OverrideTest ( string Id , QueryString queryString = default , CancellationToken _token = default , JsonTypeInfo < int > _typeInfo = default )
137+ {
138+ if ( _typeInfo == default )
139+ {
140+ _typeInfo = ApiJsonSerializerContext . Default . GetTypeInfo ( typeof ( int ) ) as JsonTypeInfo < int > ;
141+ }
142+
143+ if ( ! string . IsNullOrWhiteSpace ( Id ) )
144+ {
145+ queryString = queryString . Add ( "Id" , Id . ToString ( ) ) ;
146+ }
147+
148+ using var request = new HttpRequestMessage ( HttpMethod . Get , $ "/InheritingButDifferentType/InheritingButDifferentType{ queryString } ") ;
149+ using var result = await _client . SendAsync ( request , _token ) ;
150+ if ( _typeInfo != default )
151+ {
152+ return new Response < int > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < int > ( cancellationToken : _token , jsonTypeInfo : _typeInfo ) ?? Task . FromResult < int > ( default ) ) ) ;
153+ }
154+ else
155+ {
156+ return new Response < int > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < int > ( cancellationToken : _token ) ?? Task . FromResult < int > ( default ) ) ) ;
157+ }
158+ }
159+
160+ public string OverrideTest_Url ( string Id , QueryString queryString = default )
161+ {
162+ queryString = queryString . Add ( "Id" , Id . ToString ( ) ) ;
163+ return $ "/InheritingButDifferentType/InheritingButDifferentType{ queryString } ";
164+ }
165+
166+ public async Task < Response < global ::System . Collections . Generic . IEnumerable < string > > > Get ( QueryString queryString = default , CancellationToken _token = default , JsonTypeInfo < global ::System . Collections . Generic . IEnumerable < string > > _typeInfo = default )
167+ {
168+ if ( _typeInfo == default )
169+ {
170+ _typeInfo = ApiJsonSerializerContext . Default . GetTypeInfo ( typeof ( global ::System . Collections . Generic . IEnumerable < string > ) ) as JsonTypeInfo < global ::System . Collections . Generic . IEnumerable < string > > ;
171+ }
172+
173+ using var request = new HttpRequestMessage ( HttpMethod . Get , $ "/InheritingButDifferentType{ queryString } ") ;
174+ using var result = await _client . SendAsync ( request , _token ) ;
175+ if ( _typeInfo != default )
176+ {
177+ return new Response < global ::System . Collections . Generic . IEnumerable < string > > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < global ::System . Collections . Generic . IEnumerable < string > > ( cancellationToken : _token , jsonTypeInfo : _typeInfo ) ?? Task . FromResult < global ::System . Collections . Generic . IEnumerable < string > ? > ( default ) ) ) ;
178+ }
179+ else
180+ {
181+ return new Response < global ::System . Collections . Generic . IEnumerable < string > > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < global ::System . Collections . Generic . IEnumerable < string > > ( cancellationToken : _token ) ?? Task . FromResult < global ::System . Collections . Generic . IEnumerable < string > ? > ( default ) ) ) ;
182+ }
183+ }
184+
185+ public string Get_Url ( QueryString queryString = default )
186+ {
187+ return $ "/InheritingButDifferentType{ queryString } ";
188+ }
189+
190+ public async Task < Response < string > > GetUser ( int Id , QueryString queryString = default , CancellationToken _token = default , JsonTypeInfo < string > _typeInfo = default )
191+ {
192+ if ( _typeInfo == default )
193+ {
194+ _typeInfo = ApiJsonSerializerContext . Default . GetTypeInfo ( typeof ( string ) ) as JsonTypeInfo < string > ;
195+ }
196+
197+ if ( Id != default )
198+ {
199+ queryString = queryString . Add ( "Id" , Id . ToString ( ) ) ;
200+ }
201+
202+ using var request = new HttpRequestMessage ( HttpMethod . Get , $ "/InheritingButDifferentType{ queryString } ") ;
203+ using var result = await _client . SendAsync ( request , _token ) ;
204+ if ( _typeInfo != default )
205+ {
206+ return new Response < string > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < string > ( cancellationToken : _token , jsonTypeInfo : _typeInfo ) ?? Task . FromResult < string ? > ( default ) ) ) ;
207+ }
208+ else
209+ {
210+ return new Response < string > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < string > ( cancellationToken : _token ) ?? Task . FromResult < string ? > ( default ) ) ) ;
211+ }
212+ }
213+
214+ public string GetUser_Url ( int Id , QueryString queryString = default )
215+ {
216+ queryString = queryString . Add ( "Id" , Id . ToString ( ) ) ;
217+ return $ "/InheritingButDifferentType{ queryString } ";
218+ }
219+
220+ public async Task < Response < int > > GetUser ( string user , QueryString queryString = default , CancellationToken _token = default , JsonTypeInfo < int > _typeInfo = default )
221+ {
222+ if ( _typeInfo == default )
223+ {
224+ _typeInfo = ApiJsonSerializerContext . Default . GetTypeInfo ( typeof ( int ) ) as JsonTypeInfo < int > ;
225+ }
226+
227+ using var request = new HttpRequestMessage ( HttpMethod . Post , $ "/InheritingButDifferentType{ queryString } ") ;
228+ request . Content = JsonContent . Create ( user ) ;
229+ using var result = await _client . SendAsync ( request , _token ) ;
230+ if ( _typeInfo != default )
231+ {
232+ return new Response < int > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < int > ( cancellationToken : _token , jsonTypeInfo : _typeInfo ) ?? Task . FromResult < int > ( default ) ) ) ;
233+ }
234+ else
235+ {
236+ return new Response < int > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < int > ( cancellationToken : _token ) ?? Task . FromResult < int > ( default ) ) ) ;
237+ }
238+ }
239+
240+ public string GetUser_Url ( QueryString queryString = default )
241+ {
242+ return $ "/InheritingButDifferentType{ queryString } ";
243+ }
244+
245+ public async Task < Response < string > > GetUser2 ( string Id , string Id2 , GoLive . Generator . ApiClientGenerator . Tests . WebApi . Controllers . UserController . ComplexObjectExample example , QueryString queryString = default , CancellationToken _token = default , JsonTypeInfo < string > _typeInfo = default )
246+ {
247+ if ( _typeInfo == default )
248+ {
249+ _typeInfo = ApiJsonSerializerContext . Default . GetTypeInfo ( typeof ( string ) ) as JsonTypeInfo < string > ;
250+ }
251+
252+ if ( ! string . IsNullOrWhiteSpace ( Id ) )
253+ {
254+ queryString = queryString . Add ( "Id" , Id . ToString ( ) ) ;
255+ }
256+
257+ if ( ! string . IsNullOrWhiteSpace ( Id2 ) )
258+ {
259+ queryString = queryString . Add ( "Id2" , Id2 . ToString ( ) ) ;
260+ }
261+
262+ using var request = new HttpRequestMessage ( HttpMethod . Post , $ "/InheritingButDifferentType{ queryString } ") ;
263+ request . Content = JsonContent . Create ( example ) ;
264+ using var result = await _client . SendAsync ( request , _token ) ;
265+ if ( _typeInfo != default )
266+ {
267+ return new Response < string > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < string > ( cancellationToken : _token , jsonTypeInfo : _typeInfo ) ?? Task . FromResult < string ? > ( default ) ) ) ;
268+ }
269+ else
270+ {
271+ return new Response < string > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < string > ( cancellationToken : _token ) ?? Task . FromResult < string ? > ( default ) ) ) ;
272+ }
273+ }
274+
275+ public string GetUser2_Url ( string Id , string Id2 , QueryString queryString = default )
276+ {
277+ queryString = queryString . Add ( "Id" , Id . ToString ( ) ) ;
278+ queryString = queryString . Add ( "Id2" , Id2 . ToString ( ) ) ;
279+ return $ "/InheritingButDifferentType{ queryString } ";
280+ }
281+
282+ public async Task < Response < string > > GetUser4 ( int Id3 , QueryString queryString = default , CancellationToken _token = default , JsonTypeInfo < string > _typeInfo = default )
283+ {
284+ if ( _typeInfo == default )
285+ {
286+ _typeInfo = ApiJsonSerializerContext . Default . GetTypeInfo ( typeof ( string ) ) as JsonTypeInfo < string > ;
287+ }
288+
289+ if ( Id3 != default )
290+ {
291+ queryString = queryString . Add ( "Id3" , Id3 . ToString ( ) ) ;
292+ }
293+
294+ using var request = new HttpRequestMessage ( HttpMethod . Get , $ "/InheritingButDifferentType{ queryString } ") ;
295+ using var result = await _client . SendAsync ( request , _token ) ;
296+ if ( _typeInfo != default )
297+ {
298+ return new Response < string > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < string > ( cancellationToken : _token , jsonTypeInfo : _typeInfo ) ?? Task . FromResult < string ? > ( default ) ) ) ;
299+ }
300+ else
301+ {
302+ return new Response < string > ( result . StatusCode , result . Headers , ( result . Content ? . ReadFromJsonAsync < string > ( cancellationToken : _token ) ?? Task . FromResult < string ? > ( default ) ) ) ;
303+ }
304+ }
305+
306+ public string GetUser4_Url ( int Id3 , QueryString queryString = default )
307+ {
308+ queryString = queryString . Add ( "Id3" , Id3 . ToString ( ) ) ;
309+ return $ "/InheritingButDifferentType{ queryString } ";
310+ }
311+ }
312+
126313public class InheritingTwoClient
127314{
128315 private readonly HttpClient _client ;
0 commit comments