Skip to content

Commit fb32b1e

Browse files
author
SDKgen-Bot
committed
Operation "backend.user.resend" was added
1 parent efefbd1 commit fb32b1e

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

sdkgen.lock

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/BackendUserTag.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {BackendUserCreate} from "./BackendUserCreate";
1212
import {BackendUserUpdate} from "./BackendUserUpdate";
1313
import {CommonMessage} from "./CommonMessage";
1414
import {CommonMessageException} from "./CommonMessageException";
15+
import {Passthru} from "./Passthru";
1516

1617
export class BackendUserTag extends TagAbstract {
1718
/**
@@ -153,6 +154,42 @@ export class BackendUserTag extends TagAbstract {
153154

154155
throw new UnknownStatusCodeException('The server returned an unknown status code: ' + statusCode);
155156
}
157+
/**
158+
* Resend the activation mail to the provided user
159+
*
160+
* @returns {Promise<CommonMessage>}
161+
* @throws {CommonMessageException}
162+
* @throws {ClientException}
163+
*/
164+
public async resend(userId: string, payload: Passthru): Promise<CommonMessage> {
165+
const url = this.parser.url('/backend/user/$user_id<[0-9]+|^~>/resend', {
166+
'user_id': userId,
167+
});
168+
169+
let request: HttpRequest = {
170+
url: url,
171+
method: 'POST',
172+
headers: {
173+
'Content-Type': 'application/json',
174+
},
175+
params: this.parser.query({
176+
}, [
177+
]),
178+
data: payload
179+
};
180+
181+
const response = await this.httpClient.request(request);
182+
if (response.ok) {
183+
return await response.json() as CommonMessage;
184+
}
185+
186+
const statusCode = response.status;
187+
if (statusCode >= 0 && statusCode <= 999) {
188+
throw new CommonMessageException(await response.json() as CommonMessage);
189+
}
190+
191+
throw new UnknownStatusCodeException('The server returned an unknown status code: ' + statusCode);
192+
}
156193
/**
157194
* Updates an existing user
158195
*

0 commit comments

Comments
 (0)