@@ -67,9 +67,7 @@ export class Client {
6767 /**
6868 * Returns a `User`.
6969 */
70- public async get ( handle : string , request : CodecombatApi . GetUserRequest ) : Promise < CodecombatApi . UserResponse > {
71- const _queryParams = new URLSearchParams ( ) ;
72- _queryParams . append ( "handle" , request . handle ) ;
70+ public async get ( handle : string ) : Promise < CodecombatApi . UserResponse > {
7371 const _response = await core . fetcher ( {
7472 url : urlJoin (
7573 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -79,7 +77,6 @@ export class Client {
7977 headers : {
8078 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
8179 } ,
82- queryParameters : _queryParams ,
8380 } ) ;
8481 if ( _response . ok ) {
8582 return await serializers . users . get . Response . parse ( _response . body as serializers . users . get . Response . Raw ) ;
@@ -114,8 +111,6 @@ export class Client {
114111 handle : string ,
115112 request : CodecombatApi . ModifyUserRequest
116113 ) : Promise < CodecombatApi . UserResponse > {
117- const _queryParams = new URLSearchParams ( ) ;
118- _queryParams . append ( "handle" , request . handle ) ;
119114 const _response = await core . fetcher ( {
120115 url : urlJoin (
121116 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -125,7 +120,6 @@ export class Client {
125120 headers : {
126121 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
127122 } ,
128- queryParameters : _queryParams ,
129123 body : await serializers . users . modifyUser . Request . json ( {
130124 name : request . name ,
131125 birthday : request . birthday ,
@@ -162,12 +156,7 @@ export class Client {
162156 /**
163157 * Returns a list of `Classrooms` this user is in (if a student) or owns (if a teacher).
164158 */
165- public async getClassrooms (
166- handle : string ,
167- request : CodecombatApi . GetUserClassroomsRequest
168- ) : Promise < CodecombatApi . ClassroomResponseWithCode [ ] > {
169- const _queryParams = new URLSearchParams ( ) ;
170- _queryParams . append ( "handle" , request . handle ) ;
159+ public async getClassrooms ( handle : string ) : Promise < CodecombatApi . ClassroomResponseWithCode [ ] > {
171160 const _response = await core . fetcher ( {
172161 url : urlJoin (
173162 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -177,7 +166,6 @@ export class Client {
177166 headers : {
178167 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
179168 } ,
180- queryParameters : _queryParams ,
181169 } ) ;
182170 if ( _response . ok ) {
183171 return await serializers . users . getClassrooms . Response . parse (
@@ -210,9 +198,7 @@ export class Client {
210198 /**
211199 * Set the user's hero.
212200 */
213- public async setHero ( handle : string , request : CodecombatApi . SetHeroRequest ) : Promise < CodecombatApi . UserResponse > {
214- const _queryParams = new URLSearchParams ( ) ;
215- _queryParams . append ( "handle" , request . handle ) ;
201+ public async setHero ( handle : string , request ?: CodecombatApi . SetHeroRequest ) : Promise < CodecombatApi . UserResponse > {
216202 const _response = await core . fetcher ( {
217203 url : urlJoin (
218204 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -222,9 +208,8 @@ export class Client {
222208 headers : {
223209 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
224210 } ,
225- queryParameters : _queryParams ,
226211 body : await serializers . users . setHero . Request . json ( {
227- thangType : request . thangType ,
212+ thangType : request ? .thangType ,
228213 } ) ,
229214 } ) ;
230215 if ( _response . ok ) {
@@ -260,10 +245,8 @@ export class Client {
260245 */
261246 public async setAceConfig (
262247 handle : string ,
263- request : CodecombatApi . SetAceConfigRequest
248+ request ? : CodecombatApi . SetAceConfigRequest
264249 ) : Promise < CodecombatApi . UserResponse > {
265- const _queryParams = new URLSearchParams ( ) ;
266- _queryParams . append ( "handle" , request . handle ) ;
267250 const _response = await core . fetcher ( {
268251 url : urlJoin (
269252 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -273,11 +256,10 @@ export class Client {
273256 headers : {
274257 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
275258 } ,
276- queryParameters : _queryParams ,
277259 body : await serializers . users . setAceConfig . Request . json ( {
278- liveCompletion : request . liveCompletion ,
279- behaviors : request . behaviors ,
280- language : request . language ,
260+ liveCompletion : request ? .liveCompletion ,
261+ behaviors : request ? .behaviors ,
262+ language : request ? .language ,
281263 } ) ,
282264 } ) ;
283265 if ( _response . ok ) {
@@ -319,8 +301,6 @@ export class Client {
319301 handle : string ,
320302 request : CodecombatApi . AddOauth2IdentityRequest
321303 ) : Promise < CodecombatApi . UserResponse > {
322- const _queryParams = new URLSearchParams ( ) ;
323- _queryParams . append ( "handle" , request . handle ) ;
324304 const _response = await core . fetcher ( {
325305 url : urlJoin (
326306 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -330,7 +310,6 @@ export class Client {
330310 headers : {
331311 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
332312 } ,
333- queryParameters : _queryParams ,
334313 body : await serializers . users . addOauth2Identity . Request . json ( {
335314 provider : request . provider ,
336315 accessToken : request . accessToken ,
@@ -371,10 +350,8 @@ export class Client {
371350 */
372351 public async grantPremiumAccess (
373352 handle : string ,
374- request : CodecombatApi . GrantUserPremiumAccessRequest
353+ request : CodecombatApi . Subscription
375354 ) : Promise < CodecombatApi . UserResponse > {
376- const _queryParams = new URLSearchParams ( ) ;
377- _queryParams . append ( "handle" , request . handle ) ;
378355 const _response = await core . fetcher ( {
379356 url : urlJoin (
380357 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -384,8 +361,7 @@ export class Client {
384361 headers : {
385362 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
386363 } ,
387- queryParameters : _queryParams ,
388- body : await serializers . users . grantPremiumAccess . Request . json ( request . body ) ,
364+ body : await serializers . users . grantPremiumAccess . Request . json ( request ) ,
389365 } ) ;
390366 if ( _response . ok ) {
391367 return await serializers . users . grantPremiumAccess . Response . parse (
@@ -422,10 +398,8 @@ export class Client {
422398 */
423399 public async shortenSubscription (
424400 handle : string ,
425- request : CodecombatApi . ShortenSubscriptionRequest
401+ request : CodecombatApi . Subscription
426402 ) : Promise < CodecombatApi . UserResponse > {
427- const _queryParams = new URLSearchParams ( ) ;
428- _queryParams . append ( "handle" , request . handle ) ;
429403 const _response = await core . fetcher ( {
430404 url : urlJoin (
431405 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -435,8 +409,7 @@ export class Client {
435409 headers : {
436410 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
437411 } ,
438- queryParameters : _queryParams ,
439- body : await serializers . users . shortenSubscription . Request . json ( request . body ) ,
412+ body : await serializers . users . shortenSubscription . Request . json ( request ) ,
440413 } ) ;
441414 if ( _response . ok ) {
442415 return await serializers . users . shortenSubscription . Response . parse (
@@ -473,10 +446,8 @@ export class Client {
473446 */
474447 public async grantClassroomAccess (
475448 handle : string ,
476- request : CodecombatApi . GrantUserClassroomAccessRequest
449+ request : CodecombatApi . Subscription
477450 ) : Promise < CodecombatApi . UserResponse > {
478- const _queryParams = new URLSearchParams ( ) ;
479- _queryParams . append ( "handle" , request . handle ) ;
480451 const _response = await core . fetcher ( {
481452 url : urlJoin (
482453 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -486,8 +457,7 @@ export class Client {
486457 headers : {
487458 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
488459 } ,
489- queryParameters : _queryParams ,
490- body : await serializers . users . grantClassroomAccess . Request . json ( request . body ) ,
460+ body : await serializers . users . grantClassroomAccess . Request . json ( request ) ,
491461 } ) ;
492462 if ( _response . ok ) {
493463 return await serializers . users . grantClassroomAccess . Response . parse (
@@ -524,10 +494,8 @@ export class Client {
524494 */
525495 public async shortenLicense (
526496 handle : string ,
527- request : CodecombatApi . ShortenLicenseRequest
497+ request : CodecombatApi . Subscription
528498 ) : Promise < CodecombatApi . UserResponse > {
529- const _queryParams = new URLSearchParams ( ) ;
530- _queryParams . append ( "handle" , request . handle ) ;
531499 const _response = await core . fetcher ( {
532500 url : urlJoin (
533501 this . options . environment ?? environments . CodecombatApiEnvironment . Production ,
@@ -537,8 +505,7 @@ export class Client {
537505 headers : {
538506 Authorization : core . BasicAuth . toAuthorizationHeader ( await core . Supplier . get ( this . options . credentials ) ) ,
539507 } ,
540- queryParameters : _queryParams ,
541- body : await serializers . users . shortenLicense . Request . json ( request . body ) ,
508+ body : await serializers . users . shortenLicense . Request . json ( request ) ,
542509 } ) ;
543510 if ( _response . ok ) {
544511 return await serializers . users . shortenLicense . Response . parse (
0 commit comments