-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
PostPageReelMediaRequest.ts
66 lines (62 loc) · 1.87 KB
/
PostPageReelMediaRequest.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { AbstractPostPageMediaRequest, MediaType } from './AbstractPostPageMediaRequest';
/**
* * A request that creates a new Reels Media container.
* *
* * @author Tiago Grosso <tiagogrosso99@gmail.com>
* * @since 5.0.0
* */
export class PostPageReelMediaRequest extends AbstractPostPageMediaRequest {
/**
* The constructor
*
* @param accessToken the access token.
* @param pageId the page id.
* @param videoUrl the video URL.
* @param caption the caption.
* @param thumbOffset the thumbnail offset.
* @param shareToFeed whether the reel should be shared in the feed as well.
* @param locationId the location id.
*/
constructor(
accessToken: string,
pageId: string,
videoUrl: string,
caption?: string,
thumbOffset?: number,
shareToFeed?: boolean,
locationId?: string
) {
super(accessToken, pageId, caption, locationId);
this.params.video_url = videoUrl;
this.params.thumb_offset = thumbOffset;
this.params.share_to_feed = shareToFeed;
}
/**
* Sets the thumbnail offset time in the request.
*
* @param thumbOffset the thumbnail offset time.
*
* @returns this object, for chained invocation.
*/
public withThumbOffset(thumbOffset: number): this {
this.params.thumb_offset = thumbOffset;
return this;
}
/**
* Sets whether the reel should be shared in the feed as well.
*
* @param shareToFeed whether the reel should be shared in the feed as well.
*
* @returns this object, for chained invocation.
*/
public withShareToFeed(shareToFeed: boolean): this {
this.params.share_to_feed = shareToFeed;
return this;
}
/**
* @inheritdoc
*/
protected mediaType(): MediaType | undefined {
return MediaType.REEL;
}
}