-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
PostReplyRequest.ts
38 lines (35 loc) · 1.05 KB
/
PostReplyRequest.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { AxiosResponse } from 'axios';
import { CreatedObjectIdResponse } from '../../common/CreatedObjectIdResponse';
import { Method } from '../../RequestConfig';
import { AbstractRepliesRequest } from './AbstractRepliesRequest';
/**
* Request that creates a reply to a comment.
*
* @author Tiago Grosso <tiagogrosso99@gmail.com>
* @since 0.7.0
*/
export class PostReplyRequest extends AbstractRepliesRequest<CreatedObjectIdResponse> {
/**
* The constructor.
*
* @param accessToken The access token.
* @param commentId the id of the comment object.
* @param text the text of the reply.
*/
constructor(accessToken: string, commentId: string, text: string) {
super(accessToken, commentId);
this.params.message = text;
}
/**
* @inheritdoc
*/
protected parseResponse(response: AxiosResponse<never>): CreatedObjectIdResponse {
return new CreatedObjectIdResponse(response.data);
}
/**
* @inheritdoc
*/
protected method(): Method {
return 'POST';
}
}