instagram-graph-api
Version:
A library to help perform requests to the Instagram Graph API.
38 lines (37 loc) • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetPageMediaRequest = void 0;
const AbstractGetMediaRequest_1 = require("../../AbstractGetMediaRequest");
const GetPageMediaResponse_1 = require("./GetPageMediaResponse");
/**
* A request that gets information about the media of a page.
*
* @author Tiago Grosso <tiagogrosso99@gmail.com>
* @since 0.2.0
*/
class GetPageMediaRequest extends AbstractGetMediaRequest_1.AbstractGetMediaRequest {
/**
* The constructor
*
* @param accessToken the access token.
* @param pageId the page id.
* @param fields the fields to retrieve from the API. If no field is specified, all are retrieved.
*/
constructor(accessToken, pageId, ...fields) {
super(accessToken, ...fields);
this.pageId = pageId;
}
/**
* @inheritdoc
*/
url() {
return `/${this.pageId}/media`;
}
/**
* @inheritdoc
*/
parseResponse(response) {
return new GetPageMediaResponse_1.GetPageMediaResponse(response.data);
}
}
exports.GetPageMediaRequest = GetPageMediaRequest;