instagram-graph-api
Version:
A library to help perform requests to the Instagram Graph API.
127 lines (126 loc) • 3.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetMediaInfoResponse = void 0;
const AbstractResponse_1 = require("../../AbstractResponse");
/**
* Class that represents a response from a Media request.
*
* @author Tiago Grosso <tiagogrosso99@gmail.com>
* @since 0.1.0
*/
class GetMediaInfoResponse extends AbstractResponse_1.AbstractResponse {
/**
* Gets the id of the media object.
*
* @returns the id of the media object.
*/
getId() {
return this.data.id;
}
/**
* Gets the caption of the media object.
*
* @returns the caption of the media object.
*/
getCaption() {
return this.data.caption;
}
/**
* Gets the ig_id of the media object.
*
* @returns the ig_id of the media object.
*/
getIgId() {
return this.data.ig_id;
}
/**
* Gets the comments count of the media object.
*
* @returns the comments count of the media object.
*/
getCommentsCount() {
return this.data.comments_count;
}
/**
* Whether comments are enabled on the media object.
*
* @returns whether comments are enabled on the media object.
*/
isCommentsEnabled() {
return this.data.is_comment_enabled;
}
/**
* Gets the like count of the media object.
*
* @returns the like count of the media object.
*/
getLikeCount() {
return this.data.like_count;
}
/**
* Gets the type of the media object.
*
* @returns the type of the media object.
*/
getMediaType() {
return this.data.media_type;
}
/**
* Gets the URL of the media object.
*
* @returns the URL of the media object.
*/
getMediaUrl() {
return this.data.media_url;
}
/**
* Gets the owner of the media object.
*
* @returns the owner of the media object.
*/
getOwner() {
return this.data.owner;
}
/**
* Gets the owner id of the media object.
*
* @returns the owner id of the media object.
*/
getOwnerId() {
var _a;
return (_a = this.data.owner) === null || _a === void 0 ? void 0 : _a.id;
}
/**
* Gets the permalink of the media object.
*
* @returns the permalink of the media object.
*/
getPermalink() {
return this.data.permalink;
}
/**
* Gets the shortcode of the media object.
*
* @returns the shortcode of the media object.
*/
getShortcode() {
return this.data.shortcode;
}
/**
* Gets the timestamp of the media object.
*
* @returns the timestamp of the media object.
*/
getTimestamp() {
return this.data.timestamp != undefined ? new Date(this.data.timestamp) : undefined;
}
/**
* Gets the username of the media object.
*
* @returns the username of the media object.
*/
getUsername() {
return this.data.username;
}
}
exports.GetMediaInfoResponse = GetMediaInfoResponse;