mirror of
https://github.com/Andrewcpu/elevenlabs-api.git
synced 2026-05-06 03:00:23 -04:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
688b469f6b |
2
pom.xml
2
pom.xml
@@ -51,7 +51,7 @@
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>ossrh</id>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/projectSnapshots</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
|
||||
@@ -4,9 +4,11 @@ import net.andrewcpu.elevenlabs.enums.GeneratedAudioOutputFormat;
|
||||
import net.andrewcpu.elevenlabs.enums.StreamLatencyOptimization;
|
||||
import net.andrewcpu.elevenlabs.model.history.History;
|
||||
import net.andrewcpu.elevenlabs.model.history.HistoryItem;
|
||||
import net.andrewcpu.elevenlabs.model.projects.Project;
|
||||
import net.andrewcpu.elevenlabs.model.request.TextToSpeechRequest;
|
||||
import net.andrewcpu.elevenlabs.model.response.CreateVoiceResponse;
|
||||
import net.andrewcpu.elevenlabs.model.response.GenerationTypeModel;
|
||||
import net.andrewcpu.elevenlabs.model.response.ProjectsModelResponse;
|
||||
import net.andrewcpu.elevenlabs.model.user.Subscription;
|
||||
import net.andrewcpu.elevenlabs.model.user.User;
|
||||
import net.andrewcpu.elevenlabs.model.voice.Voice;
|
||||
@@ -14,6 +16,7 @@ import net.andrewcpu.elevenlabs.model.voice.VoiceSettings;
|
||||
import net.andrewcpu.elevenlabs.requests.ElevenLabsRequest;
|
||||
import net.andrewcpu.elevenlabs.requests.history.*;
|
||||
import net.andrewcpu.elevenlabs.requests.models.GetModelsRequest;
|
||||
import net.andrewcpu.elevenlabs.requests.projects.GetProjectsRequest;
|
||||
import net.andrewcpu.elevenlabs.requests.samples.DeleteSampleRequest;
|
||||
import net.andrewcpu.elevenlabs.requests.samples.GetSampleRequest;
|
||||
import net.andrewcpu.elevenlabs.requests.tts.PostTextToSpeechRequest;
|
||||
@@ -99,6 +102,10 @@ public class ElevenLabs {
|
||||
return sendRequest(new GetVoiceRequest(voiceId, withSettings));
|
||||
}
|
||||
|
||||
public static ProjectsModelResponse getProjects() {
|
||||
return sendRequest(new GetProjectsRequest());
|
||||
}
|
||||
|
||||
public static String deleteVoice(String voiceId) {
|
||||
return sendRequest(new DeleteVoiceRequest(voiceId));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package net.andrewcpu.elevenlabs.enums;
|
||||
|
||||
public enum ProjectOutputQuality {
|
||||
STANDARD,
|
||||
HIGH,
|
||||
ULTRA;
|
||||
|
||||
public static ProjectOutputQuality getDefault() {
|
||||
return STANDARD;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package net.andrewcpu.elevenlabs.model.projects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
|
||||
public class Chapter extends ElevenModel {
|
||||
@JsonProperty("chapter_id")
|
||||
private String chapterId;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("last_conversion_date_unix")
|
||||
private long lastConversionDateUnix;
|
||||
|
||||
@JsonProperty("conversion_progress")
|
||||
private double conversionProgress;
|
||||
|
||||
@JsonProperty("can_be_downloaded")
|
||||
private boolean canBeDownloaded;
|
||||
|
||||
@JsonProperty("state")
|
||||
private String state;
|
||||
|
||||
@JsonProperty("statistics")
|
||||
private Statistics statistics;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package net.andrewcpu.elevenlabs.model.projects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
|
||||
public class ChapterSnapshot extends ElevenModel {
|
||||
public ChapterSnapshot() {
|
||||
}
|
||||
|
||||
public ChapterSnapshot(String chapterSnapshotId, String projectId, String chapterId, long createdAtUnix, String name) {
|
||||
this.chapterSnapshotId = chapterSnapshotId;
|
||||
this.projectId = projectId;
|
||||
this.chapterId = chapterId;
|
||||
this.createdAtUnix = createdAtUnix;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@JsonProperty("chapter_snapshot_id")
|
||||
private String chapterSnapshotId;
|
||||
|
||||
@JsonProperty("project_id")
|
||||
private String projectId;
|
||||
|
||||
@JsonProperty("chapter_id")
|
||||
private String chapterId;
|
||||
|
||||
@JsonProperty("created_at_unix")
|
||||
private long createdAtUnix;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
@JsonIgnore
|
||||
public String getChapterSnapshotId() {
|
||||
return chapterSnapshotId;
|
||||
}
|
||||
@JsonIgnore
|
||||
public String getChapterId() {
|
||||
return chapterId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public long getCreatedAtUnix() {
|
||||
return createdAtUnix;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "ChapterSnapshot{" +
|
||||
"chapterSnapshotId='" + chapterSnapshotId + '\'' +
|
||||
", projectId='" + projectId + '\'' +
|
||||
", chapterId='" + chapterId + '\'' +
|
||||
", createdAtUnix=" + createdAtUnix +
|
||||
", name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package net.andrewcpu.elevenlabs.model.projects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.ElevenLabs;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Project extends ElevenModel {
|
||||
|
||||
public static List<Project> getProjects() {
|
||||
return ElevenLabs.getProjects().getProjects();
|
||||
}
|
||||
|
||||
@JsonProperty("project_id")
|
||||
private String projectId;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("create_date_unix")
|
||||
private long unixCreateDate;
|
||||
|
||||
@JsonProperty("default_title_voice_id")
|
||||
private String defaultTitleVoiceId;
|
||||
|
||||
@JsonProperty("default_paragraph_voice_id")
|
||||
private String defaultParagraphVoiceId;
|
||||
|
||||
@JsonProperty("default_model_id")
|
||||
private String defaultModelId;
|
||||
|
||||
@JsonProperty("last_conversion_date_unix")
|
||||
private long lastConversionDateUnix;
|
||||
|
||||
@JsonProperty("can_be_downloaded")
|
||||
private boolean canBeDownloaded;
|
||||
|
||||
@JsonProperty("state")
|
||||
private String state;
|
||||
|
||||
@JsonProperty("chapters")
|
||||
private List<Chapter> chapters;
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public long getUnixCreateDate() {
|
||||
return unixCreateDate;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getDefaultTitleVoiceId() {
|
||||
return defaultTitleVoiceId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getDefaultParagraphVoiceId() {
|
||||
return defaultParagraphVoiceId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getDefaultModelId() {
|
||||
return defaultModelId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public long getLastConversionDateUnix() {
|
||||
return lastConversionDateUnix;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isCanBeDownloaded() {
|
||||
return canBeDownloaded;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<Chapter> getChapters() {
|
||||
return chapters;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "Project{" +
|
||||
"projectId='" + projectId + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", unixCreateDate=" + unixCreateDate +
|
||||
", defaultTitleVoiceId='" + defaultTitleVoiceId + '\'' +
|
||||
", defaultParagraphVoiceId='" + defaultParagraphVoiceId + '\'' +
|
||||
", defaultModelId='" + defaultModelId + '\'' +
|
||||
", lastConversionDateUnix=" + lastConversionDateUnix +
|
||||
", canBeDownloaded=" + canBeDownloaded +
|
||||
", state='" + state + '\'' +
|
||||
", chapters=" + chapters +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package net.andrewcpu.elevenlabs.model.projects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
|
||||
public class ProjectSnapshot extends ElevenModel {
|
||||
public ProjectSnapshot() {
|
||||
}
|
||||
|
||||
public ProjectSnapshot(String projectSnapshotId, String projectId, long createdAtUnix, String name) {
|
||||
this.projectSnapshotId = projectSnapshotId;
|
||||
this.projectId = projectId;
|
||||
this.createdAtUnix = createdAtUnix;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@JsonProperty("project_snapshot_id")
|
||||
private String projectSnapshotId;
|
||||
|
||||
@JsonProperty("project_id")
|
||||
private String projectId;
|
||||
|
||||
@JsonProperty("created_at_unix")
|
||||
private long createdAtUnix;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
@JsonIgnore
|
||||
public String getProjectSnapshotId() {
|
||||
return projectSnapshotId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public long getCreatedAtUnix() {
|
||||
return createdAtUnix;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "Snapshot{" +
|
||||
"projectSnapshotId='" + projectSnapshotId + '\'' +
|
||||
", projectId='" + projectId + '\'' +
|
||||
", createdAtUnix=" + createdAtUnix +
|
||||
", name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package net.andrewcpu.elevenlabs.model.projects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
|
||||
public class Statistics extends ElevenModel {
|
||||
@JsonProperty("characters_unconverted")
|
||||
private int charactersUnconverted;
|
||||
|
||||
@JsonProperty("characters_converted")
|
||||
private int charactersConverted;
|
||||
|
||||
@JsonProperty("paragraphs_converted")
|
||||
private int paragraphsConverted;
|
||||
|
||||
@JsonProperty("paragraphs_unconverted")
|
||||
private int paragraphsUnconverted;
|
||||
|
||||
|
||||
public Statistics(int charactersUnconverted, int charactersConverted, int paragraphsConverted, int paragraphsUnconverted) {
|
||||
this.charactersUnconverted = charactersUnconverted;
|
||||
this.charactersConverted = charactersConverted;
|
||||
this.paragraphsConverted = paragraphsConverted;
|
||||
this.paragraphsUnconverted = paragraphsUnconverted;
|
||||
}
|
||||
|
||||
public Statistics() {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int getCharactersUnconverted() {
|
||||
return charactersUnconverted;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int getCharactersConverted() {
|
||||
return charactersConverted;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int getParagraphsConverted() {
|
||||
return paragraphsConverted;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int getParagraphsUnconverted() {
|
||||
return paragraphsUnconverted;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "Statistics{" +
|
||||
"charactersUnconverted=" + charactersUnconverted +
|
||||
", charactersConverted=" + charactersConverted +
|
||||
", paragraphsConverted=" + paragraphsConverted +
|
||||
", paragraphsUnconverted=" + paragraphsUnconverted +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package net.andrewcpu.elevenlabs.model.request;
|
||||
|
||||
import net.andrewcpu.elevenlabs.enums.ProjectOutputQuality;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.invoke.StringConcatFactory;
|
||||
|
||||
public class AddProjectRequest {
|
||||
private String name;
|
||||
private String fromUrl;
|
||||
private File fromDocument;
|
||||
private String defaultTitleVoiceId;
|
||||
private String defaultParagraphVoiceId;
|
||||
private String defaultModelId;
|
||||
private ProjectOutputQuality projectOutputQuality;
|
||||
private String title;
|
||||
private String author;
|
||||
private String isbnNumber;
|
||||
private boolean acxVolumeNormalization;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public AddProjectRequest setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFromUrl() {
|
||||
return fromUrl;
|
||||
}
|
||||
|
||||
public AddProjectRequest setFromUrl(String fromUrl) {
|
||||
this.fromUrl = fromUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public File getFromDocument() {
|
||||
return fromDocument;
|
||||
}
|
||||
|
||||
public AddProjectRequest setFromDocument(File fromDocument) {
|
||||
this.fromDocument = fromDocument;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDefaultTitleVoiceId() {
|
||||
return defaultTitleVoiceId;
|
||||
}
|
||||
|
||||
public AddProjectRequest setDefaultTitleVoiceId(String defaultTitleVoiceId) {
|
||||
this.defaultTitleVoiceId = defaultTitleVoiceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDefaultParagraphVoiceId() {
|
||||
return defaultParagraphVoiceId;
|
||||
}
|
||||
|
||||
public AddProjectRequest setDefaultParagraphVoiceId(String defaultParagraphVoiceId) {
|
||||
this.defaultParagraphVoiceId = defaultParagraphVoiceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDefaultModelId() {
|
||||
return defaultModelId;
|
||||
}
|
||||
|
||||
public AddProjectRequest setDefaultModelId(String defaultModelId) {
|
||||
this.defaultModelId = defaultModelId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProjectOutputQuality getProjectOutputQuality() {
|
||||
return projectOutputQuality;
|
||||
}
|
||||
|
||||
public AddProjectRequest setProjectOutputQuality(ProjectOutputQuality projectOutputQuality) {
|
||||
this.projectOutputQuality = projectOutputQuality;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public AddProjectRequest setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public AddProjectRequest setAuthor(String author) {
|
||||
this.author = author;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsbnNumber() {
|
||||
return isbnNumber;
|
||||
}
|
||||
|
||||
public AddProjectRequest setIsbnNumber(String isbnNumber) {
|
||||
this.isbnNumber = isbnNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isAcxVolumeNormalization() {
|
||||
return acxVolumeNormalization;
|
||||
}
|
||||
|
||||
public AddProjectRequest setAcxVolumeNormalization(boolean acxVolumeNormalization) {
|
||||
this.acxVolumeNormalization = acxVolumeNormalization;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package net.andrewcpu.elevenlabs.model.request;
|
||||
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
|
||||
import javax.management.loading.PrivateClassLoader;
|
||||
import java.io.File;
|
||||
|
||||
public class CreateAudioNativeProjectRequest extends ElevenModel {
|
||||
private String name;
|
||||
private String image;
|
||||
private String author;
|
||||
private boolean small;
|
||||
private String textColor;
|
||||
private String backgroundColor;
|
||||
private Integer sessionization;
|
||||
private String voiceId;
|
||||
private String modelId;
|
||||
private File file;
|
||||
private boolean autoConvert;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setImage(String image) {
|
||||
this.image = image;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setAuthor(String author) {
|
||||
this.author = author;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSmall() {
|
||||
return small;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setSmall(boolean small) {
|
||||
this.small = small;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTextColor() {
|
||||
return textColor;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setTextColor(String textColor) {
|
||||
this.textColor = textColor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBackgroundColor() {
|
||||
return backgroundColor;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setBackgroundColor(String backgroundColor) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getSessionization() {
|
||||
return sessionization;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setSessionization(Integer sessionization) {
|
||||
this.sessionization = sessionization;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getVoiceId() {
|
||||
return voiceId;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setVoiceId(String voiceId) {
|
||||
this.voiceId = voiceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getModelId() {
|
||||
return modelId;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setModelId(String modelId) {
|
||||
this.modelId = modelId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setFile(File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isAutoConvert() {
|
||||
return autoConvert;
|
||||
}
|
||||
|
||||
public CreateAudioNativeProjectRequest setAutoConvert(boolean autoConvert) {
|
||||
this.autoConvert = autoConvert;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.andrewcpu.elevenlabs.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
import net.andrewcpu.elevenlabs.model.projects.ChapterSnapshot;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ChapterSnapshotsModelResponse extends ElevenModel {
|
||||
|
||||
public ChapterSnapshotsModelResponse(List<ChapterSnapshot> snapshots) {
|
||||
this.snapshots = snapshots;
|
||||
}
|
||||
|
||||
public ChapterSnapshotsModelResponse() {
|
||||
}
|
||||
|
||||
@JsonProperty("snapshots")
|
||||
private List<ChapterSnapshot> snapshots;
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
public List<ChapterSnapshot> getSnapshots() {
|
||||
return snapshots;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "ChapterSnapshotsModelResponse{" +
|
||||
"snapshots=" + snapshots +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.andrewcpu.elevenlabs.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
import net.andrewcpu.elevenlabs.model.projects.Chapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ChaptersModelResponse extends ElevenModel {
|
||||
@JsonProperty("chapters")
|
||||
private List<Chapter> chapters;
|
||||
|
||||
public ChaptersModelResponse(List<Chapter> chapters) {
|
||||
this.chapters = chapters;
|
||||
}
|
||||
|
||||
public ChaptersModelResponse() {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<Chapter> getChapters() {
|
||||
return chapters;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "ChaptersModelResponse{" +
|
||||
"chapters=" + chapters +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package net.andrewcpu.elevenlabs.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
|
||||
public class CreateAudioEnabledProjectModelResponse extends ElevenModel {
|
||||
@JsonProperty("project_id")
|
||||
private String projectId;
|
||||
|
||||
@JsonProperty("converting")
|
||||
private boolean converting;
|
||||
|
||||
@JsonProperty("html_snippet")
|
||||
private String htmlSnippet;
|
||||
|
||||
public CreateAudioEnabledProjectModelResponse(String projectId, boolean converting, String htmlSnippet) {
|
||||
this.projectId = projectId;
|
||||
this.converting = converting;
|
||||
this.htmlSnippet = htmlSnippet;
|
||||
}
|
||||
|
||||
public CreateAudioEnabledProjectModelResponse() {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isConverting() {
|
||||
return converting;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getHtmlSnippet() {
|
||||
return htmlSnippet;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "CreateAudioEnabledProjectModelResponse{" +
|
||||
"projectId='" + projectId + '\'' +
|
||||
", converting=" + converting +
|
||||
", htmlSnippet='" + htmlSnippet + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.andrewcpu.elevenlabs.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
import net.andrewcpu.elevenlabs.model.projects.Project;
|
||||
|
||||
public class ProjectModelResponse extends ElevenModel {
|
||||
@JsonProperty("project")
|
||||
private Project project;
|
||||
|
||||
public ProjectModelResponse(Project project) {
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
public ProjectModelResponse() {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Project getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "ProjectModelResponse{" +
|
||||
"project=" + project +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.andrewcpu.elevenlabs.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
import net.andrewcpu.elevenlabs.model.projects.ProjectSnapshot;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProjectSnapshotsModelResponse extends ElevenModel {
|
||||
@JsonProperty("snapshots")
|
||||
private List<ProjectSnapshot> projectSnapshots;
|
||||
|
||||
|
||||
public ProjectSnapshotsModelResponse(List<ProjectSnapshot> projectSnapshots) {
|
||||
this.projectSnapshots = projectSnapshots;
|
||||
}
|
||||
|
||||
public ProjectSnapshotsModelResponse() {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<ProjectSnapshot> getSnapshots() {
|
||||
return projectSnapshots;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "ProjectSnapshotsModelResponse{" +
|
||||
"snapshots=" + projectSnapshots +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.andrewcpu.elevenlabs.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import net.andrewcpu.elevenlabs.model.ElevenModel;
|
||||
import net.andrewcpu.elevenlabs.model.projects.Project;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProjectsModelResponse extends ElevenModel {
|
||||
@JsonProperty("projects")
|
||||
private List<Project> projects;
|
||||
|
||||
public ProjectsModelResponse(List<Project> projects) {
|
||||
this.projects = projects;
|
||||
}
|
||||
|
||||
public ProjectsModelResponse() {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<Project> getProjects() {
|
||||
return projects;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String toString() {
|
||||
return "ProjectsModelResponse{" +
|
||||
"projects=" + projects +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.andrewcpu.elevenlabs.requests.audionative;
|
||||
|
||||
import net.andrewcpu.elevenlabs.model.request.CreateAudioNativeProjectRequest;
|
||||
import net.andrewcpu.elevenlabs.model.response.CreateAudioEnabledProjectModelResponse;
|
||||
import net.andrewcpu.elevenlabs.requests.PostRequest;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class PostCreateAudioNativeProjectRequest extends PostRequest<CreateAudioEnabledProjectModelResponse> {
|
||||
private CreateAudioNativeProjectRequest request;
|
||||
public PostCreateAudioNativeProjectRequest(CreateAudioNativeProjectRequest request) {
|
||||
super("v1/audio-native", CreateAudioEnabledProjectModelResponse.class);
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
Map<String, Object> payload = new HashMap<>();
|
||||
payload.put("name", request.getName());
|
||||
payload.put("image", request.getImage());
|
||||
payload.put("author", request.getAuthor());
|
||||
payload.put("small", request.isSmall());
|
||||
payload.put("text_color", request.getTextColor());
|
||||
payload.put("background_color", request.getBackgroundColor());
|
||||
payload.put("sessionization", request.getSessionization());
|
||||
payload.put("voice_id", request.getVoiceId());
|
||||
payload.put("model_id", request.getModelId());
|
||||
payload.put("file", request.getFile());
|
||||
payload.put("auto_convert", request.isAutoConvert());
|
||||
return payload;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.requests.DeleteRequest;
|
||||
|
||||
public class DeleteChapterByIdRequest extends DeleteRequest<String> {
|
||||
|
||||
public DeleteChapterByIdRequest(String projectId, String chapterId) {
|
||||
super("v1/projects/" + projectId + "/chapters/" + chapterId, String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.requests.DeleteRequest;
|
||||
|
||||
public class DeleteProjectByIdRequest extends DeleteRequest<String> {
|
||||
public DeleteProjectByIdRequest(String projectId) {
|
||||
super("v1/projects/" + projectId, String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.model.projects.Chapter;
|
||||
import net.andrewcpu.elevenlabs.requests.GetRequest;
|
||||
|
||||
public class GetChapterByIdRequest extends GetRequest<Chapter> {
|
||||
public GetChapterByIdRequest(String projectId, String chapterId) {
|
||||
super("v1/projects/" + projectId + "/chapters/" + chapterId, Chapter.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.requests.GetRequest;
|
||||
|
||||
public class GetChapterSnapshotsRequest extends GetRequest<GetChapterSnapshotsRequest> {
|
||||
public GetChapterSnapshotsRequest(String projectId, String chapterId) {
|
||||
super("v1/projects/" + projectId + "/chapters/" + chapterId + "/snapshots", GetChapterSnapshotsRequest.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.model.projects.Project;
|
||||
import net.andrewcpu.elevenlabs.requests.GetRequest;
|
||||
|
||||
public class GetProjectByIdRequest extends GetRequest<Project> {
|
||||
public GetProjectByIdRequest(String projectId) {
|
||||
super("v1/projects/" + projectId, Project.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.model.response.ChaptersModelResponse;
|
||||
import net.andrewcpu.elevenlabs.requests.GetRequest;
|
||||
|
||||
public class GetProjectChaptersRequest extends GetRequest<ChaptersModelResponse> {
|
||||
public GetProjectChaptersRequest(String projectId) {
|
||||
super("v1/projects/" + projectId + "/chapters", ChaptersModelResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.model.response.ProjectSnapshotsModelResponse;
|
||||
import net.andrewcpu.elevenlabs.requests.GetRequest;
|
||||
|
||||
public class GetProjectSnapshotsRequest extends GetRequest<ProjectSnapshotsModelResponse> {
|
||||
public GetProjectSnapshotsRequest(String projectId) {
|
||||
super("v1/projects/" + projectId + "/snapshots", ProjectSnapshotsModelResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.model.response.ProjectsModelResponse;
|
||||
import net.andrewcpu.elevenlabs.requests.GetRequest;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class GetProjectsRequest extends GetRequest<ProjectsModelResponse> {
|
||||
public GetProjectsRequest() {
|
||||
super("v1/projects", ProjectsModelResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.model.request.AddProjectRequest;
|
||||
import net.andrewcpu.elevenlabs.model.response.ProjectModelResponse;
|
||||
import net.andrewcpu.elevenlabs.requests.PostRequest;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class PostAddProjectRequest extends PostRequest<ProjectModelResponse> {
|
||||
private AddProjectRequest request;
|
||||
public PostAddProjectRequest(AddProjectRequest request) {
|
||||
super("v1/projects/add", ProjectModelResponse.class);
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
Map<String, Object> payload = new HashMap<>();
|
||||
payload.put("name",request.getName());
|
||||
payload.put("from_url", request.getFromUrl());
|
||||
payload.put("from_document", request.getFromDocument());
|
||||
payload.put("default_title_voice_id", request.getDefaultTitleVoiceId());
|
||||
payload.put("default_paragraph_voice_id", request.getDefaultParagraphVoiceId());
|
||||
payload.put("default_model_id", request.getDefaultModelId());
|
||||
payload.put("quality_preset", request.getProjectOutputQuality().name().toLowerCase());
|
||||
payload.put("title", request.getTitle());
|
||||
payload.put("author", request.getAuthor());
|
||||
payload.put("isbn_number", request.getIsbnNumber());
|
||||
payload.put("acx_volume_normalization", request.isAcxVolumeNormalization());
|
||||
return payload;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.requests.PostRequest;
|
||||
|
||||
public class PostConvertChapterRequest extends PostRequest<String> {
|
||||
public PostConvertChapterRequest(String projectId, String chapterId) {
|
||||
super("v1/projects/" + projectId + "/chapters/" + chapterId + "/convert", String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.requests.PostRequest;
|
||||
|
||||
public class PostConvertProjectRequest extends PostRequest<String> {
|
||||
public PostConvertProjectRequest(String projectId) {
|
||||
super("v1/projects/" + projectId + "/convert", String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.requests.PostRequest;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
public class PostStreamChapterSnapshotAudioRequest extends PostRequest<InputStream> {
|
||||
public PostStreamChapterSnapshotAudioRequest(String projectId, String chapterId, String chapterSnapshotId) {
|
||||
super("v1/projects/" + projectId + "/chapters/" + chapterId + "/snapshots/" + chapterSnapshotId + "/stream", InputStream.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.andrewcpu.elevenlabs.requests.projects;
|
||||
|
||||
import net.andrewcpu.elevenlabs.requests.PostRequest;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
public class PostStreamProjectSnapshotAudioRequest extends PostRequest<InputStream> {
|
||||
public PostStreamProjectSnapshotAudioRequest(String projectId, String snapshotId) {
|
||||
super("v1/projects/" + projectId + "/snapshots/" + snapshotId + "/stream", InputStream.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPayload() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user