Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/java/com/fopost/sdk/model/BlueskyLanguages.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.fopost.sdk.model;

import java.util.List;

/** The default post languages for a connection: up to three BCP-47 tags. */
public record BlueskyLanguages(List<String> languages) {}
13 changes: 13 additions & 0 deletions src/main/java/com/fopost/sdk/model/InstagramAudio.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.fopost.sdk.model;

/** A track a Reel can carry; pass {@code id} as the {@code audio_id} platform setting. */
public record InstagramAudio(
String id,
String title,
String artist,
Integer durationMs,
String audioType,
String coverArtworkUrl,
String previewUrl,
String username,
Boolean isAdsEligible) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.fopost.sdk.model;

/** What this account has published in the rolling window, and what is left. */
public record InstagramPublishingLimit(
int quotaUsage, Integer quotaTotal, Integer quotaDurationSec, Integer remaining) {}
15 changes: 15 additions & 0 deletions src/main/java/com/fopost/sdk/model/InstagramStory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.fopost.sdk.model;

import java.util.Map;

/** A story still inside its 24 hours; {@code insights} is present only when asked for. */
public record InstagramStory(
String id,
String mediaType,
String mediaProductType,
String permalink,
String mediaUrl,
String thumbnailUrl,
String caption,
String timestamp,
Map<String, Integer> insights) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.fopost.sdk.model;

import java.util.Map;

/** The insight set for one story. */
public record InstagramStoryInsights(String storyId, Map<String, Integer> insights) {}
5 changes: 5 additions & 0 deletions src/main/java/com/fopost/sdk/model/LinkedInMention.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.fopost.sdk.model;

/** An entity a post can mention; {@code annotation} is what the post text carries. */
public record LinkedInMention(
String urn, String name, String vanityName, String logoUrl, String type, String annotation) {}
4 changes: 4 additions & 0 deletions src/main/java/com/fopost/sdk/model/PinterestBoard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.fopost.sdk.model;

/** A Pinterest board a Pin can land on; pass {@code id} as the {@code board_id} platform setting. */
public record PinterestBoard(String id, String name, String privacy, String description, String image) {}
17 changes: 17 additions & 0 deletions src/main/java/com/fopost/sdk/model/TikTokCreatorInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.fopost.sdk.model;

import java.util.List;

/**
* The switches TikTok enforces at publish time. They are set on the TikTok account itself, not in
* FoPost, so a disabled one cannot be turned back on here.
*/
public record TikTokCreatorInfo(
String username,
String nickname,
String avatarUrl,
List<String> privacyLevelOptions,
boolean commentDisabled,
boolean duetDisabled,
boolean stitchDisabled,
Integer maxVideoPostDurationSec) {}
13 changes: 13 additions & 0 deletions src/main/java/com/fopost/sdk/model/TikTokMusic.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.fopost.sdk.model;

/**
* A track from TikTok's Commercial Music Library. Pass {@code id} as the {@code music_id} platform
* setting to attach it to a post.
*/
public record TikTokMusic(
String id,
String title,
String author,
Integer durationSec,
String coverUrl,
String previewUrl) {}
6 changes: 6 additions & 0 deletions src/main/java/com/fopost/sdk/model/TikTokPlace.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.fopost.sdk.model;

/**
* A place a post can be tagged with. Pass {@code id} as the {@code location_id} platform setting.
*/
public record TikTokPlace(String id, String name, String address, String city, String country) {}
15 changes: 15 additions & 0 deletions src/main/java/com/fopost/sdk/model/TikTokVideoSource.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.fopost.sdk.model;

/**
* One of the account's own videos, resolved from a share link. TikTok serves no raw media file, so
* {@code downloadUrl} is the share address, which is what a repurpose run reads.
*/
public record TikTokVideoSource(
String videoId,
String title,
String description,
Integer durationSec,
String coverImageUrl,
String shareUrl,
String embedLink,
String downloadUrl) {}
11 changes: 11 additions & 0 deletions src/main/java/com/fopost/sdk/model/YouTubeCaptionTrack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.fopost.sdk.model;

/** A caption track on one of the channel's videos; {@code language} is a BCP-47 tag. */
public record YouTubeCaptionTrack(
String id,
String language,
String name,
String trackKind,
boolean isDraft,
boolean isAutoSynced,
String lastUpdated) {}
11 changes: 11 additions & 0 deletions src/main/java/com/fopost/sdk/model/YouTubePlaylist.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.fopost.sdk.model;

/** A playlist on the channel; {@code isDefault} marks the one a new video joins when none is picked. */
public record YouTubePlaylist(
String id,
String title,
String description,
String privacy,
Integer itemCount,
String thumbnailUrl,
boolean isDefault) {}
4 changes: 4 additions & 0 deletions src/main/java/com/fopost/sdk/model/YouTubeTranscript.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.fopost.sdk.model;

/** One caption track read back as text, in SRT. */
public record YouTubeTranscript(String captionId, String transcript) {}
32 changes: 32 additions & 0 deletions src/main/java/com/fopost/sdk/param/CreatePinterestBoardParams.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.fopost.sdk.param;

import java.util.LinkedHashMap;
import java.util.Map;

/** A new Pinterest board. {@code privacy} is PUBLIC, PROTECTED or SECRET; unset means PUBLIC. */
public final class CreatePinterestBoardParams {

private final Map<String, Object> body = new LinkedHashMap<>();

private CreatePinterestBoardParams(String name) {
body.put("name", name);
}

public static CreatePinterestBoardParams of(String name) {
return new CreatePinterestBoardParams(name);
}

public CreatePinterestBoardParams description(String description) {
body.put("description", description);
return this;
}

public CreatePinterestBoardParams privacy(String privacy) {
body.put("privacy", privacy);
return this;
}

public Map<String, Object> toMap() {
return new LinkedHashMap<>(body);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.fopost.sdk.param;

import java.util.LinkedHashMap;
import java.util.Map;

/** A new playlist. {@code privacy} is public, unlisted or private; unset means private. */
public final class CreateYouTubePlaylistParams {

private final Map<String, Object> body = new LinkedHashMap<>();

private CreateYouTubePlaylistParams(String title) {
body.put("title", title);
}

public static CreateYouTubePlaylistParams of(String title) {
return new CreateYouTubePlaylistParams(title);
}

public CreateYouTubePlaylistParams description(String description) {
body.put("description", description);
return this;
}

public CreateYouTubePlaylistParams privacy(String privacy) {
body.put("privacy", privacy);
return this;
}

public Map<String, Object> toMap() {
return new LinkedHashMap<>(body);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.fopost.sdk.param;

import java.util.LinkedHashMap;
import java.util.Map;

/**
* A caption track to upload. {@code body} is the subtitle file itself; YouTube reads SRT and WebVTT
* and works out which from the bytes, so the format is not declared.
*/
public final class UploadYouTubeCaptionsParams {

private final Map<String, Object> body = new LinkedHashMap<>();

private UploadYouTubeCaptionsParams(String language, String subtitles) {
body.put("language", language);
body.put("body", subtitles);
}

/** {@code language} is a BCP-47 tag. */
public static UploadYouTubeCaptionsParams of(String language, String subtitles) {
return new UploadYouTubeCaptionsParams(language, subtitles);
}

public UploadYouTubeCaptionsParams name(String name) {
body.put("name", name);
return this;
}

public UploadYouTubeCaptionsParams isDraft(boolean isDraft) {
body.put("is_draft", isDraft);
return this;
}

public Map<String, Object> toMap() {
return new LinkedHashMap<>(body);
}
}
Loading
Loading