instagram-graph-api
Version:
A library to help perform requests to the Instagram Graph API.
37 lines (36 loc) • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetMediaChildrenRequest = void 0;
const AbstractRequest_1 = require("../../AbstractRequest");
const GetMediaChildrenResponse_1 = require("./GetMediaChildrenResponse");
/**
* A request that gets the children of an album media object.
*
* @author Tiago Grosso <tiagogrosso99@gmail.com>
* @since 0.5.0
*/
class GetMediaChildrenRequest extends AbstractRequest_1.AbstractRequest {
/**
* The constructor
*
* @param accessToken the access token.
* @param mediaId the id of the media object (must be an album).
*/
constructor(accessToken, mediaId) {
super(accessToken);
this.mediaId = mediaId;
}
/**
* @inheritdoc
*/
parseResponse(response) {
return new GetMediaChildrenResponse_1.GetMediaChildrenResponse(response.data);
}
/**
* @inheritdoc
*/
url() {
return `/${this.mediaId}/children`;
}
}
exports.GetMediaChildrenRequest = GetMediaChildrenRequest;