mirror of
https://github.com/taigrr/elevenlabs.git
synced 2026-04-02 03:08:57 -07:00
refactor model names
This commit is contained in:
166
api_history.go
166
api_history.go
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* ElevenLabs API Documentation
|
* ElevenLabs API Documentation
|
||||||
*
|
*
|
||||||
@@ -11,12 +10,14 @@ package swagger
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
|
||||||
"github.com/antihax/optional"
|
"github.com/antihax/optional"
|
||||||
|
"github.com/taigrr/elevenlabs/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Linger please
|
// Linger please
|
||||||
@@ -24,7 +25,6 @@ var (
|
|||||||
_ context.Context
|
_ context.Context
|
||||||
)
|
)
|
||||||
|
|
||||||
type HistoryApiService service
|
|
||||||
/*
|
/*
|
||||||
HistoryApiService Delete History Item
|
HistoryApiService Delete History Item
|
||||||
Delete a history item by its ID
|
Delete a history item by its ID
|
||||||
@@ -35,16 +35,12 @@ Delete a history item by its ID
|
|||||||
@return Object
|
@return Object
|
||||||
*/
|
*/
|
||||||
|
|
||||||
type HistoryApiDeleteHistoryItemV1HistoryHistoryItemIdDeleteOpts struct {
|
|
||||||
XiApiKey optional.String
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *HistoryApiService) DeleteHistoryItemV1HistoryHistoryItemIdDelete(ctx context.Context, historyItemId string, localVarOptionals *HistoryApiDeleteHistoryItemV1HistoryHistoryItemIdDeleteOpts) (Object, *http.Response, error) {
|
func (a *HistoryApiService) DeleteHistoryItemV1HistoryHistoryItemIdDelete(ctx context.Context, historyItemId string, localVarOptionals *HistoryApiDeleteHistoryItemV1HistoryHistoryItemIdDeleteOpts) (Object, *http.Response, error) {
|
||||||
var (
|
var (
|
||||||
localVarHttpMethod = strings.ToUpper("Delete")
|
localVarHttpMethod = strings.ToUpper("Delete")
|
||||||
localVarPostBody interface{}
|
localVarPostBody interface{}
|
||||||
localVarFileName string
|
localVarFileName string
|
||||||
localVarFileBytes []byte
|
localVarFileBytes []byte
|
||||||
localVarReturnValue Object
|
localVarReturnValue Object
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -94,7 +90,7 @@ func (a *HistoryApiService) DeleteHistoryItemV1HistoryHistoryItemIdDelete(ctx co
|
|||||||
|
|
||||||
if localVarHttpResponse.StatusCode < 300 {
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
// If we succeed, return the data, otherwise pass on to decode error.
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return localVarReturnValue, localVarHttpResponse, err
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
}
|
}
|
||||||
@@ -102,34 +98,35 @@ func (a *HistoryApiService) DeleteHistoryItemV1HistoryHistoryItemIdDelete(ctx co
|
|||||||
|
|
||||||
if localVarHttpResponse.StatusCode >= 300 {
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
newErr := GenericSwaggerError{
|
newErr := GenericSwaggerError{
|
||||||
body: localVarBody,
|
body: localVarBody,
|
||||||
error: localVarHttpResponse.Status,
|
error: localVarHttpResponse.Status,
|
||||||
}
|
}
|
||||||
if localVarHttpResponse.StatusCode == 200 {
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
var v Object
|
var v Object
|
||||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newErr.error = err.Error()
|
newErr.error = err.Error()
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
if localVarHttpResponse.StatusCode == 422 {
|
if localVarHttpResponse.StatusCode == 422 {
|
||||||
var v HttpValidationError
|
var v HttpValidationError
|
||||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newErr.error = err.Error()
|
newErr.error = err.Error()
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
|
|
||||||
return localVarReturnValue, localVarHttpResponse, nil
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
HistoryApiService Delete History Items
|
HistoryApiService Delete History Items
|
||||||
Delete a number of history items by their IDs.
|
Delete a number of history items by their IDs.
|
||||||
@@ -141,15 +138,15 @@ Delete a number of history items by their IDs.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
type HistoryApiDeleteHistoryItemsV1HistoryDeletePostOpts struct {
|
type HistoryApiDeleteHistoryItemsV1HistoryDeletePostOpts struct {
|
||||||
XiApiKey optional.String
|
XiApiKey optional.String
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *HistoryApiService) DeleteHistoryItemsV1HistoryDeletePost(ctx context.Context, body BodyDeleteHistoryItemsV1HistoryDeletePost, localVarOptionals *HistoryApiDeleteHistoryItemsV1HistoryDeletePostOpts) (Object, *http.Response, error) {
|
func (a *HistoryApiService) DeleteHistoryItemsV1HistoryDeletePost(ctx context.Context, body BodyDeleteHistoryItemsV1HistoryDeletePost, localVarOptionals *HistoryApiDeleteHistoryItemsV1HistoryDeletePostOpts) (Object, *http.Response, error) {
|
||||||
var (
|
var (
|
||||||
localVarHttpMethod = strings.ToUpper("Post")
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
localVarPostBody interface{}
|
localVarPostBody interface{}
|
||||||
localVarFileName string
|
localVarFileName string
|
||||||
localVarFileBytes []byte
|
localVarFileBytes []byte
|
||||||
localVarReturnValue Object
|
localVarReturnValue Object
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -200,7 +197,7 @@ func (a *HistoryApiService) DeleteHistoryItemsV1HistoryDeletePost(ctx context.Co
|
|||||||
|
|
||||||
if localVarHttpResponse.StatusCode < 300 {
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
// If we succeed, return the data, otherwise pass on to decode error.
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return localVarReturnValue, localVarHttpResponse, err
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
}
|
}
|
||||||
@@ -208,34 +205,35 @@ func (a *HistoryApiService) DeleteHistoryItemsV1HistoryDeletePost(ctx context.Co
|
|||||||
|
|
||||||
if localVarHttpResponse.StatusCode >= 300 {
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
newErr := GenericSwaggerError{
|
newErr := GenericSwaggerError{
|
||||||
body: localVarBody,
|
body: localVarBody,
|
||||||
error: localVarHttpResponse.Status,
|
error: localVarHttpResponse.Status,
|
||||||
}
|
}
|
||||||
if localVarHttpResponse.StatusCode == 200 {
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
var v Object
|
var v Object
|
||||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newErr.error = err.Error()
|
newErr.error = err.Error()
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
if localVarHttpResponse.StatusCode == 422 {
|
if localVarHttpResponse.StatusCode == 422 {
|
||||||
var v HttpValidationError
|
var v HttpValidationError
|
||||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newErr.error = err.Error()
|
newErr.error = err.Error()
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
|
|
||||||
return localVarReturnValue, localVarHttpResponse, nil
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
HistoryApiService Download History Items
|
HistoryApiService Download History Items
|
||||||
Download one or more history items. If one history item ID is provided, we will return a single audio file. If more than one history item IDs are provided, we will provide the history items packed into a .zip file.
|
Download one or more history items. If one history item ID is provided, we will return a single audio file. If more than one history item IDs are provided, we will provide the history items packed into a .zip file.
|
||||||
@@ -247,7 +245,7 @@ Download one or more history items. If one history item ID is provided, we will
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
type HistoryApiDownloadHistoryItemsV1HistoryDownloadPostOpts struct {
|
type HistoryApiDownloadHistoryItemsV1HistoryDownloadPostOpts struct {
|
||||||
XiApiKey optional.String
|
XiApiKey optional.String
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *HistoryApiService) DownloadHistoryItemsV1HistoryDownloadPost(ctx context.Context, body BodyDownloadHistoryItemsV1HistoryDownloadPost, localVarOptionals *HistoryApiDownloadHistoryItemsV1HistoryDownloadPostOpts) (*http.Response, error) {
|
func (a *HistoryApiService) DownloadHistoryItemsV1HistoryDownloadPost(ctx context.Context, body BodyDownloadHistoryItemsV1HistoryDownloadPost, localVarOptionals *HistoryApiDownloadHistoryItemsV1HistoryDownloadPostOpts) (*http.Response, error) {
|
||||||
@@ -256,7 +254,6 @@ func (a *HistoryApiService) DownloadHistoryItemsV1HistoryDownloadPost(ctx contex
|
|||||||
localVarPostBody interface{}
|
localVarPostBody interface{}
|
||||||
localVarFileName string
|
localVarFileName string
|
||||||
localVarFileBytes []byte
|
localVarFileBytes []byte
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
@@ -304,27 +301,27 @@ func (a *HistoryApiService) DownloadHistoryItemsV1HistoryDownloadPost(ctx contex
|
|||||||
return localVarHttpResponse, err
|
return localVarHttpResponse, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if localVarHttpResponse.StatusCode >= 300 {
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
newErr := GenericSwaggerError{
|
newErr := GenericSwaggerError{
|
||||||
body: localVarBody,
|
body: localVarBody,
|
||||||
error: localVarHttpResponse.Status,
|
error: localVarHttpResponse.Status,
|
||||||
}
|
}
|
||||||
if localVarHttpResponse.StatusCode == 422 {
|
if localVarHttpResponse.StatusCode == 422 {
|
||||||
var v HttpValidationError
|
var v HttpValidationError
|
||||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newErr.error = err.Error()
|
newErr.error = err.Error()
|
||||||
return localVarHttpResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.model = v
|
|
||||||
return localVarHttpResponse, newErr
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
return localVarHttpResponse, newErr
|
return localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
|
|
||||||
return localVarHttpResponse, nil
|
return localVarHttpResponse, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
HistoryApiService Get Audio From History Item
|
HistoryApiService Get Audio From History Item
|
||||||
Returns the audio of an history item.
|
Returns the audio of an history item.
|
||||||
@@ -336,7 +333,7 @@ Returns the audio of an history item.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
type HistoryApiGetAudioFromHistoryItemV1HistoryHistoryItemIdAudioGetOpts struct {
|
type HistoryApiGetAudioFromHistoryItemV1HistoryHistoryItemIdAudioGetOpts struct {
|
||||||
XiApiKey optional.String
|
XiApiKey optional.String
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *HistoryApiService) GetAudioFromHistoryItemV1HistoryHistoryItemIdAudioGet(ctx context.Context, historyItemId string, localVarOptionals *HistoryApiGetAudioFromHistoryItemV1HistoryHistoryItemIdAudioGetOpts) (*http.Response, error) {
|
func (a *HistoryApiService) GetAudioFromHistoryItemV1HistoryHistoryItemIdAudioGet(ctx context.Context, historyItemId string, localVarOptionals *HistoryApiGetAudioFromHistoryItemV1HistoryHistoryItemIdAudioGetOpts) (*http.Response, error) {
|
||||||
@@ -345,7 +342,6 @@ func (a *HistoryApiService) GetAudioFromHistoryItemV1HistoryHistoryItemIdAudioGe
|
|||||||
localVarPostBody interface{}
|
localVarPostBody interface{}
|
||||||
localVarFileName string
|
localVarFileName string
|
||||||
localVarFileBytes []byte
|
localVarFileBytes []byte
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
@@ -392,27 +388,27 @@ func (a *HistoryApiService) GetAudioFromHistoryItemV1HistoryHistoryItemIdAudioGe
|
|||||||
return localVarHttpResponse, err
|
return localVarHttpResponse, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if localVarHttpResponse.StatusCode >= 300 {
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
newErr := GenericSwaggerError{
|
newErr := GenericSwaggerError{
|
||||||
body: localVarBody,
|
body: localVarBody,
|
||||||
error: localVarHttpResponse.Status,
|
error: localVarHttpResponse.Status,
|
||||||
}
|
}
|
||||||
if localVarHttpResponse.StatusCode == 422 {
|
if localVarHttpResponse.StatusCode == 422 {
|
||||||
var v HttpValidationError
|
var v HttpValidationError
|
||||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newErr.error = err.Error()
|
newErr.error = err.Error()
|
||||||
return localVarHttpResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.model = v
|
|
||||||
return localVarHttpResponse, newErr
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
return localVarHttpResponse, newErr
|
return localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
|
|
||||||
return localVarHttpResponse, nil
|
return localVarHttpResponse, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
HistoryApiService Get Generated Items
|
HistoryApiService Get Generated Items
|
||||||
Returns metadata about all your generated audio.
|
Returns metadata about all your generated audio.
|
||||||
@@ -423,16 +419,16 @@ Returns metadata about all your generated audio.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
type HistoryApiGetGeneratedItemsV1HistoryGetOpts struct {
|
type HistoryApiGetGeneratedItemsV1HistoryGetOpts struct {
|
||||||
XiApiKey optional.String
|
XiApiKey optional.String
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *HistoryApiService) GetGeneratedItemsV1HistoryGet(ctx context.Context, localVarOptionals *HistoryApiGetGeneratedItemsV1HistoryGetOpts) (GetHistoryResponseModel, *http.Response, error) {
|
func GetGeneratedItemsV1HistoryGet(ctx context.Context, localVarOptionals *HistoryApiGetGeneratedItemsV1HistoryGetOpts) (types.GetHistoryResponseModel, *http.Response, error) {
|
||||||
var (
|
var (
|
||||||
localVarHttpMethod = strings.ToUpper("Get")
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
localVarPostBody interface{}
|
localVarPostBody interface{}
|
||||||
localVarFileName string
|
localVarFileName string
|
||||||
localVarFileBytes []byte
|
localVarFileBytes []byte
|
||||||
localVarReturnValue GetHistoryResponseModel
|
localVarReturnValue types.GetHistoryResponseModel
|
||||||
)
|
)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
@@ -480,7 +476,7 @@ func (a *HistoryApiService) GetGeneratedItemsV1HistoryGet(ctx context.Context, l
|
|||||||
|
|
||||||
if localVarHttpResponse.StatusCode < 300 {
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
// If we succeed, return the data, otherwise pass on to decode error.
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return localVarReturnValue, localVarHttpResponse, err
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
}
|
}
|
||||||
@@ -488,28 +484,28 @@ func (a *HistoryApiService) GetGeneratedItemsV1HistoryGet(ctx context.Context, l
|
|||||||
|
|
||||||
if localVarHttpResponse.StatusCode >= 300 {
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
newErr := GenericSwaggerError{
|
newErr := GenericSwaggerError{
|
||||||
body: localVarBody,
|
body: localVarBody,
|
||||||
error: localVarHttpResponse.Status,
|
error: localVarHttpResponse.Status,
|
||||||
}
|
}
|
||||||
if localVarHttpResponse.StatusCode == 200 {
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
var v GetHistoryResponseModel
|
var v GetHistoryResponseModel
|
||||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newErr.error = err.Error()
|
newErr.error = err.Error()
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
if localVarHttpResponse.StatusCode == 422 {
|
if localVarHttpResponse.StatusCode == 422 {
|
||||||
var v HttpValidationError
|
var v HttpValidationError
|
||||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newErr.error = err.Error()
|
newErr.error = err.Error()
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
return localVarReturnValue, localVarHttpResponse, newErr
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
}
|
}
|
||||||
|
|||||||
9
client/client.go
Normal file
9
client/client.go
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package client
|
||||||
|
|
||||||
|
type Client struct {
|
||||||
|
apiKey string
|
||||||
|
}
|
||||||
|
|
||||||
|
func New(apiKey string) Client {
|
||||||
|
return Client{apiKey: apiKey}
|
||||||
|
}
|
||||||
115
types/types.go
115
types/types.go
@@ -2,65 +2,31 @@ package types
|
|||||||
|
|
||||||
import "os"
|
import "os"
|
||||||
|
|
||||||
type AddVoiceResponseModel struct {
|
type AddVoiceResponse struct {
|
||||||
VoiceId string `json:"voice_id"`
|
VoiceID string `json:"voice_id"`
|
||||||
}
|
|
||||||
|
|
||||||
// Voice settings overriding stored setttings for the given voice. They are applied only on the given TTS request.
|
|
||||||
type AllOfBodyTextToSpeechV1TextToSpeechVoiceIdPostVoiceSettings struct {
|
|
||||||
Stability float64 `json:"stability"`
|
|
||||||
SimilarityBoost float64 `json:"similarity_boost"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Voice settings overriding stored setttings for the given voice. They are applied only on the given TTS request.
|
|
||||||
type AllOfBodyTextToSpeechV1TextToSpeechVoiceIdStreamPostVoiceSettings struct {
|
|
||||||
Stability float64 `json:"stability"`
|
|
||||||
SimilarityBoost float64 `json:"similarity_boost"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type AnyOfValidationErrorLocItems struct{}
|
type AnyOfValidationErrorLocItems struct{}
|
||||||
|
|
||||||
type BodyAddVoiceV1VoicesAddPost struct {
|
type HistoryPost struct {
|
||||||
// The name that identifies this voice. This will be displayed in the dropdown of the website.
|
HistoryItemIds []string `json:"history_item_ids"`
|
||||||
Name string `json:"name"`
|
}
|
||||||
// One or more audio files to clone the voice from
|
type Voice struct {
|
||||||
Files []*os.File `json:"files"`
|
Name string `json:"name"` // The name that identifies this voice. This will be displayed in the dropdown of the website.
|
||||||
// How would you describe the voice?
|
Files []*os.File `json:"files,omitempty"` // Audio files to add to the voice
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"` // How would you describe the voice?
|
||||||
// Serialized labels dictionary for the voice.
|
Labels string `json:"labels,omitempty"` // Serialized labels dictionary for the voice.
|
||||||
Labels string `json:"labels,omitempty"`
|
}
|
||||||
|
type TTS struct {
|
||||||
|
Text string `json:"text"` // The text that will get converted into speech. Currently only English text is supported.
|
||||||
|
VoiceSettings SynthesisOptions `json:"voice_settings,omitempty"` // Voice settings are applied only on the given TTS request.
|
||||||
}
|
}
|
||||||
|
|
||||||
type BodyDeleteHistoryItemsV1HistoryDeletePost struct {
|
type SynthesisOptions struct {
|
||||||
// A list of history items to remove, you can get IDs of history items and other metadata using the GET https://api.elevenlabs.io/v1/history endpoint.
|
Stability float64 `json:"stability"`
|
||||||
HistoryItemIds []string `json:"history_item_ids"`
|
SimilarityBoost float64 `json:"similarity_boost"`
|
||||||
}
|
|
||||||
type BodyDownloadHistoryItemsV1HistoryDownloadPost struct {
|
|
||||||
// A list of history items to download, you can get IDs of history items and other metadata using the GET https://api.elevenlabs.io/v1/history endpoint.
|
|
||||||
HistoryItemIds []string `json:"history_item_ids"`
|
|
||||||
}
|
|
||||||
type BodyEditVoiceV1VoicesVoiceIdEditPost struct {
|
|
||||||
// The name that identifies this voice. This will be displayed in the dropdown of the website.
|
|
||||||
Name string `json:"name"`
|
|
||||||
// Audio files to add to the voice
|
|
||||||
Files []*os.File `json:"files,omitempty"`
|
|
||||||
// How would you describe the voice?
|
|
||||||
Description string `json:"description,omitempty"`
|
|
||||||
// Serialized labels dictionary for the voice.
|
|
||||||
Labels string `json:"labels,omitempty"`
|
|
||||||
}
|
|
||||||
type BodyTextToSpeechV1TextToSpeechVoiceIdPost struct {
|
|
||||||
// The text that will get converted into speech. Currently only English text is supported.
|
|
||||||
Text string `json:"text"`
|
|
||||||
// Voice settings overriding stored setttings for the given voice. They are applied only on the given TTS request.
|
|
||||||
VoiceSettings *AllOfBodyTextToSpeechV1TextToSpeechVoiceIdPostVoiceSettings `json:"voice_settings,omitempty"`
|
|
||||||
}
|
|
||||||
type BodyTextToSpeechV1TextToSpeechVoiceIdStreamPost struct {
|
|
||||||
// The text that will get converted into speech. Currently only English text is supported.
|
|
||||||
Text string `json:"text"`
|
|
||||||
// Voice settings overriding stored setttings for the given voice. They are applied only on the given TTS request.
|
|
||||||
VoiceSettings *AllOfBodyTextToSpeechV1TextToSpeechVoiceIdStreamPostVoiceSettings `json:"voice_settings,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExtendedSubscriptionResponseModel struct {
|
type ExtendedSubscriptionResponseModel struct {
|
||||||
Tier string `json:"tier"`
|
Tier string `json:"tier"`
|
||||||
CharacterCount int32 `json:"character_count"`
|
CharacterCount int32 `json:"character_count"`
|
||||||
@@ -77,7 +43,7 @@ type ExtendedSubscriptionResponseModel struct {
|
|||||||
CanUseDelayedPaymentMethods bool `json:"can_use_delayed_payment_methods"`
|
CanUseDelayedPaymentMethods bool `json:"can_use_delayed_payment_methods"`
|
||||||
Currency string `json:"currency"`
|
Currency string `json:"currency"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
NextInvoice *InvoiceResponseModel `json:"next_invoice"`
|
NextInvoice InvoiceResponseModel `json:"next_invoice"`
|
||||||
}
|
}
|
||||||
type FeedbackResponseModel struct {
|
type FeedbackResponseModel struct {
|
||||||
ThumbsUp bool `json:"thumbs_up"`
|
ThumbsUp bool `json:"thumbs_up"`
|
||||||
@@ -90,7 +56,7 @@ type FeedbackResponseModel struct {
|
|||||||
ReviewStatus string `json:"review_status,omitempty"`
|
ReviewStatus string `json:"review_status,omitempty"`
|
||||||
}
|
}
|
||||||
type FineTuningResponseModel struct {
|
type FineTuningResponseModel struct {
|
||||||
ModelId string `json:"model_id"`
|
ModelID string `json:"model_id"`
|
||||||
IsAllowedToFineTune bool `json:"is_allowed_to_fine_tune"`
|
IsAllowedToFineTune bool `json:"is_allowed_to_fine_tune"`
|
||||||
FineTuningRequested bool `json:"fine_tuning_requested"`
|
FineTuningRequested bool `json:"fine_tuning_requested"`
|
||||||
FinetuningState string `json:"finetuning_state"`
|
FinetuningState string `json:"finetuning_state"`
|
||||||
@@ -122,7 +88,7 @@ type HistoryItemResponseModel struct {
|
|||||||
type HttpValidationError struct {
|
type HttpValidationError struct {
|
||||||
Detail []ValidationError `json:"detail,omitempty"`
|
Detail []ValidationError `json:"detail,omitempty"`
|
||||||
}
|
}
|
||||||
type InvoiceResponseModel struct {
|
type Invoice struct {
|
||||||
AmountDueCents int32 `json:"amount_due_cents"`
|
AmountDueCents int32 `json:"amount_due_cents"`
|
||||||
NextPaymentAttemptUnix int32 `json:"next_payment_attempt_unix"`
|
NextPaymentAttemptUnix int32 `json:"next_payment_attempt_unix"`
|
||||||
}
|
}
|
||||||
@@ -137,7 +103,7 @@ type RecordingResponseModel struct {
|
|||||||
UploadDateUnix int32 `json:"upload_date_unix"`
|
UploadDateUnix int32 `json:"upload_date_unix"`
|
||||||
Transcription string `json:"transcription"`
|
Transcription string `json:"transcription"`
|
||||||
}
|
}
|
||||||
type SampleResponseModel struct {
|
type Sample struct {
|
||||||
SampleId string `json:"sample_id"`
|
SampleId string `json:"sample_id"`
|
||||||
FileName string `json:"file_name"`
|
FileName string `json:"file_name"`
|
||||||
MimeType string `json:"mime_type"`
|
MimeType string `json:"mime_type"`
|
||||||
@@ -145,12 +111,7 @@ type SampleResponseModel struct {
|
|||||||
Hash string `json:"hash"`
|
Hash string `json:"hash"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// The settings for a specific voice.
|
type Subscription struct {
|
||||||
type Settings struct {
|
|
||||||
Stability float64 `json:"stability"`
|
|
||||||
SimilarityBoost float64 `json:"similarity_boost"`
|
|
||||||
}
|
|
||||||
type SubscriptionResponseModel struct {
|
|
||||||
Tier string `json:"tier"`
|
Tier string `json:"tier"`
|
||||||
CharacterCount int32 `json:"character_count"`
|
CharacterCount int32 `json:"character_count"`
|
||||||
CharacterLimit int32 `json:"character_limit"`
|
CharacterLimit int32 `json:"character_limit"`
|
||||||
@@ -173,9 +134,9 @@ type TtsModelResponseModel struct {
|
|||||||
SupportedLanguage []LanguageResponseModel `json:"supported_language"`
|
SupportedLanguage []LanguageResponseModel `json:"supported_language"`
|
||||||
}
|
}
|
||||||
type UserResponseModel struct {
|
type UserResponseModel struct {
|
||||||
Subscription *SubscriptionResponseModel `json:"subscription"`
|
Subscription Subscription `json:"subscription"`
|
||||||
IsNewUser bool `json:"is_new_user"`
|
IsNewUser bool `json:"is_new_user"`
|
||||||
XiApiKey string `json:"xi_api_key"`
|
XiAPIKey string `json:"xi_api_key"`
|
||||||
}
|
}
|
||||||
type ValidationError struct {
|
type ValidationError struct {
|
||||||
Loc []AnyOfValidationErrorLocItems `json:"loc"`
|
Loc []AnyOfValidationErrorLocItems `json:"loc"`
|
||||||
@@ -191,18 +152,14 @@ type VerificationAttemptResponseModel struct {
|
|||||||
Recording *RecordingResponseModel `json:"recording"`
|
Recording *RecordingResponseModel `json:"recording"`
|
||||||
}
|
}
|
||||||
type VoiceResponseModel struct {
|
type VoiceResponseModel struct {
|
||||||
VoiceId string `json:"voice_id"`
|
VoiceId string `json:"voice_id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Samples []SampleResponseModel `json:"samples"`
|
Samples []Sample `json:"samples"`
|
||||||
Category string `json:"category"`
|
Category string `json:"category"`
|
||||||
FineTuning *FineTuningResponseModel `json:"fine_tuning"`
|
FineTuning FineTuningResponseModel `json:"fine_tuning"`
|
||||||
Labels map[string]string `json:"labels"`
|
Labels map[string]string `json:"labels"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
PreviewUrl string `json:"preview_url"`
|
PreviewUrl string `json:"preview_url"`
|
||||||
AvailableForTiers []string `json:"available_for_tiers"`
|
AvailableForTiers []string `json:"available_for_tiers"`
|
||||||
Settings *VoiceSettingsResponseModel `json:"settings"`
|
Settings SynthesisOptions `json:"settings"`
|
||||||
}
|
|
||||||
type VoiceSettingsResponseModel struct {
|
|
||||||
Stability float64 `json:"stability"`
|
|
||||||
SimilarityBoost float64 `json:"similarity_boost"`
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user