Skip to content

Commit 0fa459c

Browse files
committed
Update generated OpenAPI
1 parent 6a19465 commit 0fa459c

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

src/lib/api/internal/v1/apis/UsersApi.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,43 @@
1515

1616
import * as runtime from '../runtime';
1717
import type {
18+
BasicUserInfo,
19+
OpenShockProblem,
1820
UserSelfResponseLegacyDataResponse,
1921
} from '../models/index';
2022
import {
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
*/
3141
export 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
*/
5174
export 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

Comments
 (0)