1515
1616import * as runtime from '../runtime' ;
1717import type {
18+ BasicUserInfo ,
19+ OpenShockProblem ,
1820 UserSelfResponseLegacyDataResponse ,
1921} from '../models/index' ;
2022import {
23+ BasicUserInfoFromJSON ,
24+ BasicUserInfoToJSON ,
25+ OpenShockProblemFromJSON ,
26+ OpenShockProblemToJSON ,
2127 UserSelfResponseLegacyDataResponseFromJSON ,
2228 UserSelfResponseLegacyDataResponseToJSON ,
2329} from '../models/index' ;
2430
31+ export interface UsersGetByNameRequest {
32+ username : string ;
33+ }
34+
2535/**
2636 * UsersApi - interface
2737 *
2838 * @export
2939 * @interface UsersApiInterface
3040 */
3141export interface UsersApiInterface {
42+ /**
43+ *
44+ * @param {string } username
45+ * @param {* } [options] Override http request option.
46+ * @throws {RequiredError }
47+ * @memberof UsersApiInterface
48+ */
49+ usersGetByNameRaw ( requestParameters : UsersGetByNameRequest , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < runtime . ApiResponse < BasicUserInfo > > ;
50+
51+ /**
52+ */
53+ usersGetByName ( username : string , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < BasicUserInfo > ;
54+
3255 /**
3356 *
3457 * @summary Get the current user\'s information.
@@ -50,6 +73,45 @@ export interface UsersApiInterface {
5073 */
5174export class UsersApi extends runtime . BaseAPI implements UsersApiInterface {
5275
76+ /**
77+ */
78+ async usersGetByNameRaw ( requestParameters : UsersGetByNameRequest , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < runtime . ApiResponse < BasicUserInfo > > {
79+ if ( requestParameters [ 'username' ] == null ) {
80+ throw new runtime . RequiredError (
81+ 'username' ,
82+ 'Required parameter "username" was null or undefined when calling usersGetByName().'
83+ ) ;
84+ }
85+
86+ const queryParameters : any = { } ;
87+
88+ const headerParameters : runtime . HTTPHeaders = { } ;
89+
90+ if ( this . configuration && this . configuration . apiKey ) {
91+ headerParameters [ "OpenShockToken" ] = await this . configuration . apiKey ( "OpenShockToken" ) ; // ApiToken authentication
92+ }
93+
94+
95+ let urlPath = `/1/users/by-name/{username}` ;
96+ urlPath = urlPath . replace ( `{${ "username" } }` , encodeURIComponent ( String ( requestParameters [ 'username' ] ) ) ) ;
97+
98+ const response = await this . request ( {
99+ path : urlPath ,
100+ method : 'GET' ,
101+ headers : headerParameters ,
102+ query : queryParameters ,
103+ } , initOverrides ) ;
104+
105+ return new runtime . JSONApiResponse ( response , ( jsonValue ) => BasicUserInfoFromJSON ( jsonValue ) ) ;
106+ }
107+
108+ /**
109+ */
110+ async usersGetByName ( username : string , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < BasicUserInfo > {
111+ const response = await this . usersGetByNameRaw ( { username : username } , initOverrides ) ;
112+ return await response . value ( ) ;
113+ }
114+
53115 /**
54116 * Get the current user\'s information.
55117 */
0 commit comments