Documentation
¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type BasicAuth
- type Configuration
- type CorporaCollection
- type Corpus
- type ErrorResponse
- type ExtraFile
- type Fragment
- type FragmentVariant
- type Job
- type JobOutput
- type JobResult
- type JobsCollection
- type Project
- type ProjectsCollection
- type Result
- type TtsApiService
- func (a *TtsApiService) Corpora(ctx context.Context, projectID string) (CorporaCollection, *http.Response, error)
- func (a *TtsApiService) Corpus(ctx context.Context, projectID string, name string) (Corpus, *http.Response, error)
- func (a *TtsApiService) CreateCorpus(ctx context.Context, projectID string, name string, body string) (*http.Response, error)
- func (a *TtsApiService) CreateJob(ctx context.Context, projectID string, job Job) (Job, *http.Response, error)
- func (a *TtsApiService) CreateProject(ctx context.Context, project Project) (Project, *http.Response, error)
- func (a *TtsApiService) DeleteCorpus(ctx context.Context, projectID string, name string) (*http.Response, error)
- func (a *TtsApiService) DeleteJob(ctx context.Context, projectID string, jobID string) (*http.Response, error)
- func (a *TtsApiService) DeleteProject(ctx context.Context, projectID string) (*http.Response, error)
- func (a *TtsApiService) Job(ctx context.Context, projectID string, jobID string) (Job, *http.Response, error)
- func (a *TtsApiService) JobOutputs(ctx context.Context, projectID string, jobID string) ([]JobOutput, *http.Response, error)
- func (a *TtsApiService) JobResult(ctx context.Context, projectID string, jobID string) (JobResult, *http.Response, error)
- func (a *TtsApiService) Jobs(ctx context.Context, projectID string, ...) (JobsCollection, *http.Response, error)
- func (a *TtsApiService) Project(ctx context.Context, projectID string) (Project, *http.Response, error)
- func (a *TtsApiService) Projects(ctx context.Context) (ProjectsCollection, *http.Response, error)
- func (a *TtsApiService) TrainProject(ctx context.Context, projectID string) (*http.Response, error)
- func (a *TtsApiService) UpdateProject(ctx context.Context, projectID string, project Project) (Project, *http.Response, error)
- func (a *TtsApiService) UploadVideo(ctx context.Context, projectID string, videoUploadBody VideoUploadBody) (UploadSession, *http.Response, error)
- type UploadSession
- type VideoUploadBody
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
// API Services
TtsApi *TtsApiService
// contains filtered or unexported fields
}
APIClient manages communication with the Tts API API v2.0.0 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the swagger operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type BasicAuth ¶
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Configuration ¶
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type CorporaCollection ¶
type CorporaCollection struct {
// An array of Corpus files
Corpora []Corpus `json:"corpora,omitempty"`
}
type Fragment ¶
type Fragment struct {
// The start time in seconds of the fragment from the input audio
StartTime float32 `json:"start_time,omitempty"`
// An array of FragmentVariants
Variants []FragmentVariant `json:"variants,omitempty"`
// The end time in seconds of the fragment from the input audio
EndTime float32 `json:"end_time,omitempty"`
}
type FragmentVariant ¶
type Job ¶
type Job struct {
// The ID of the job.
Id string `json:"id,omitempty"`
// The name of the job.
Name string `json:"name,omitempty"`
// The name of the input file
OriginalFilename string `json:"original_filename,omitempty"`
// The ID of the project.
ProjectId string `json:"project_id,omitempty"`
// The URL of source file.
SourceUrl string `json:"source_url,omitempty"`
// Determines the state of transcription job.
Status string `json:"status,omitempty"`
// If the status of the job is 'error', returns the state of job.
Error_ string `json:"error,omitempty"`
// A percentage that indicates the progress of the job.
Progress int32 `json:"progress,omitempty"`
// The confidence score of the job in the range of 0 to 100.
Confidence int32 `json:"confidence,omitempty"`
// The duration of the input audio in milliseconds.
Duration int32 `json:"duration,omitempty"`
// The bitrate of the input audio.
Bitrate int32 `json:"bitrate,omitempty"`
// The sample rate of the input audio.
SampleRate int32 `json:"sample_rate,omitempty"`
// The format of the input audio.
Format string `json:"format,omitempty"`
// The file size of the input file.
FileSize int64 `json:"file_size,omitempty"`
// Words used for model training, separated by space.
CustomWords string `json:"custom_words,omitempty"`
// A date and time when the job was created
CreatedAt string `json:"created_at,omitempty"`
// A date and time when the job was updated
UpdatedAt string `json:"updated_at,omitempty"`
}
type JobResult ¶
type JobResult struct {
// An array of Results
Results []Result `json:"results,omitempty"`
}
type JobsCollection ¶
type JobsCollection struct {
Jobs []Job `json:"jobs,omitempty"`
// A number of the fetched page.
Page int32 `json:"page,omitempty"`
// A number of jobs per page.
PerPage int32 `json:"per_page,omitempty"`
// A number of pages.
PageCount int32 `json:"page_count,omitempty"`
// A number of all jobs.
TotalCount int32 `json:"total_count,omitempty"`
}
type Project ¶
type Project struct {
// The ID of the Project.
Id string `json:"id,omitempty"`
// The name of the Project.
Name string `json:"name,omitempty"`
// The description of the Project.
Description string `json:"description,omitempty"`
// Determines a stage of training.
Status string `json:"status,omitempty"`
// The language code of model.
Language string `json:"language,omitempty"`
// The sample rate of model.
SampleRate int32 `json:"sample_rate,omitempty"`
// If true, the service replaces profanity from output with asterisks.
ProfanityFilter bool `json:"profanity_filter,omitempty"`
// Indicates whether video preview should be generated.
GenerateProxy bool `json:"generate_proxy,omitempty"`
// Words used for model training, separated by space.
CustomWords string `json:"custom_words,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
// A date and time when the project was created
CreatedAt string `json:"created_at,omitempty"`
// A date and time when the project was updated
UpdatedAt string `json:"updated_at,omitempty"`
}
type ProjectsCollection ¶
type ProjectsCollection struct {
Projects []Project `json:"projects,omitempty"`
// A number of the fetched page.
Page int32 `json:"page,omitempty"`
// A number of projects per page.
PerPage int32 `json:"per_page,omitempty"`
// A number of pages.
PageCount int32 `json:"page_count,omitempty"`
// A number of all projects.
TotalCount int32 `json:"total_count,omitempty"`
}
type Result ¶
type Result struct {
Transcript string `json:"transcript,omitempty"`
// The start time in seconds of the transcript from the input audio
StartTime float32 `json:"start_time,omitempty"`
// An array of Fragments
Fragments []Fragment `json:"fragments,omitempty"`
// The end time time in seconds of the transcript from the input audio
EndTime float32 `json:"end_time,omitempty"`
// The confidence score of the result in the range of 0 to 1
Confidence float32 `json:"confidence,omitempty"`
}
type TtsApiService ¶
type TtsApiService service
func (*TtsApiService) Corpora ¶
func (a *TtsApiService) Corpora(ctx context.Context, projectID string) (CorporaCollection, *http.Response, error)
TtsApiService Returns a collection of Corpora Returns a collection of Corpora * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @return CorporaCollection
func (*TtsApiService) Corpus ¶
func (a *TtsApiService) Corpus(ctx context.Context, projectID string, name string) (Corpus, *http.Response, error)
TtsApiService Returns the Corpus Returns the Corpus * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param name Corpus name @return Corpus
func (*TtsApiService) CreateCorpus ¶
func (a *TtsApiService) CreateCorpus(ctx context.Context, projectID string, name string, body string) (*http.Response, error)
TtsApiService Creates a new Corpus Creates a new Corpus * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param name Corpus name @param body @return
func (*TtsApiService) CreateJob ¶
func (a *TtsApiService) CreateJob(ctx context.Context, projectID string, job Job) (Job, *http.Response, error)
TtsApiService Creates a new Job Creates a new Job * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param job @return Job
func (*TtsApiService) CreateProject ¶
func (a *TtsApiService) CreateProject(ctx context.Context, project Project) (Project, *http.Response, error)
TtsApiService Creates a new Project Creates a new Project * @param ctx context.Context for authentication, logging, tracing, etc. @param project @return Project
func (*TtsApiService) DeleteCorpus ¶
func (a *TtsApiService) DeleteCorpus(ctx context.Context, projectID string, name string) (*http.Response, error)
TtsApiService Creates a new Corpus Creates a new Corpus * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param name Corpus name @return
func (*TtsApiService) DeleteJob ¶
func (a *TtsApiService) DeleteJob(ctx context.Context, projectID string, jobID string) (*http.Response, error)
TtsApiService Deletes the Job Deletes the Job * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param jobID @return
func (*TtsApiService) DeleteProject ¶
func (a *TtsApiService) DeleteProject(ctx context.Context, projectID string) (*http.Response, error)
TtsApiService Deletes the Project Deletes the Project * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @return
func (*TtsApiService) Job ¶
func (a *TtsApiService) Job(ctx context.Context, projectID string, jobID string) (Job, *http.Response, error)
TtsApiService Returns the Job Returns the Job * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param jobID @return Job
func (*TtsApiService) JobOutputs ¶
func (a *TtsApiService) JobOutputs(ctx context.Context, projectID string, jobID string) ([]JobOutput, *http.Response, error)
TtsApiService Returns the Job Outputs Returns the Job Outputs * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param jobID @return []JobOutput
func (*TtsApiService) JobResult ¶
func (a *TtsApiService) JobResult(ctx context.Context, projectID string, jobID string) (JobResult, *http.Response, error)
TtsApiService Returns the Job Result Returns the Job Result * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param jobID @return JobResult
func (*TtsApiService) Jobs ¶
func (a *TtsApiService) Jobs(ctx context.Context, projectID string, localVarOptionals map[string]interface{}) (JobsCollection, *http.Response, error)
TtsApiService Returns a collection of Jobs Returns a collection of Jobs * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param optional (nil or map[string]interface{}) with one or more of:
@param "page" (int32) page number @param "perPage" (int32) number of records per page
@return JobsCollection
func (*TtsApiService) Project ¶
func (a *TtsApiService) Project(ctx context.Context, projectID string) (Project, *http.Response, error)
TtsApiService Returns the Project Returns the Project * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @return Project
func (*TtsApiService) Projects ¶
func (a *TtsApiService) Projects(ctx context.Context) (ProjectsCollection, *http.Response, error)
TtsApiService Returns a collection of Projects Returns a collection of Projects * @param ctx context.Context for authentication, logging, tracing, etc. @return ProjectsCollection
func (*TtsApiService) TrainProject ¶
TtsApiService Queues training Queues training * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @return
func (*TtsApiService) UpdateProject ¶
func (a *TtsApiService) UpdateProject(ctx context.Context, projectID string, project Project) (Project, *http.Response, error)
TtsApiService Updates an existing Project Updates an existing Project * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param project @return Project
func (*TtsApiService) UploadVideo ¶
func (a *TtsApiService) UploadVideo(ctx context.Context, projectID string, videoUploadBody VideoUploadBody) (UploadSession, *http.Response, error)
TtsApiService Creates an upload session * @param ctx context.Context for authentication, logging, tracing, etc. @param projectID ID of the Project @param videoUploadBody @return UploadSession
type UploadSession ¶
type UploadSession struct {
// An unique identifier of the UploadSession.
Id string `json:"id"`
// An URL to which chunks of the uploaded file should be sent
Location string `json:"location"`
// A number of chunks that are expected by the upstream.
Parts int32 `json:"parts,string,omitempty"`
// An expected size of uploaded chunks.
PartSize int32 `json:"part_size,string,omitempty"`
// A maximum number of concurrent connections.
MaxConnections int32 `json:"max_connections,string,omitempty"`
// An object containing additional files uploaded using the session.
ExtraFiles *interface{} `json:"extra_files,omitempty"`
}
type VideoUploadBody ¶
type VideoUploadBody struct {
// Size of the file that will be uploaded in `bytes`.
FileSize int64 `json:"file_size"`
// Name of the file that will be uploaded.
FileName string `json:"file_name"`
Profiles string `json:"profiles,omitempty"`
MultiChunk bool `json:"multi_chunk,omitempty"`
// A list of names of additional files that will be uploaded.
ExtraFiles []ExtraFile `json:"extra_files,omitempty"`
Job *Job `json:"job,omitempty"`
}