UNPKG

instagram-graph-api

Version:

A library to help perform requests to the Instagram Graph API.

38 lines (37 loc) 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PostMediaCommentRequest = void 0; const AbstractMediaCommentsRequest_1 = require("./AbstractMediaCommentsRequest"); const CreatedObjectIdResponse_1 = require("../../common/CreatedObjectIdResponse"); /** * A request that creates a comment on a media object. * * @author Tiago Grosso <tiagogrosso99@gmail.com> * @since 0.5.0 */ class PostMediaCommentRequest extends AbstractMediaCommentsRequest_1.AbstractMediaCommentsRequest { /** * The constructor. * * @param accessToken The access token. * @param mediaId the id of the media object. * @param text the text of the comment. */ constructor(accessToken, mediaId, text) { super(accessToken, mediaId); this.params.message = text; } /** * @inheritdoc */ parseResponse(response) { return new CreatedObjectIdResponse_1.CreatedObjectIdResponse(response.data); } /** * @inheritdoc */ method() { return 'POST'; } } exports.PostMediaCommentRequest = PostMediaCommentRequest;