UNPKG

instagram-graph-api

Version:

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

35 lines (34 loc) 1.21 kB
import { AxiosResponse } from 'axios'; import { AlbumMetric, SimplePostMetric, StoryMetric } from '../../../Enums'; import { AbstractRequest } from '../../AbstractRequest'; import { GetMediaInsightsResponse } from './GetMediaInsightsResponse'; /** * An abstract class to represent request that gets insights about a media object. * * @param T te type of metrics. This matches the type of media object (Post or Story). * * @author Tiago Grosso <tiagogrosso99@gmail.com> * @since 0.2.0 */ export declare abstract class AbstractGetMediaInsightsRequest<T extends SimplePostMetric | StoryMetric | AlbumMetric> extends AbstractRequest<GetMediaInsightsResponse> { /** * The media object id. */ private mediaId; /** * The constructor. * * @param accessToken the access token. * @param mediaId the media object id (must be of type 'Post'). * @param metrics the metrics to retrieve from the API. */ constructor(accessToken: string, mediaId: string, metrics: Set<T>); /** * @inheritdoc */ protected url(): string; /** * @inheritdoc */ protected parseResponse(response: AxiosResponse<never>): GetMediaInsightsResponse; }