@audc/salute-tts
Version:
Synthesis client for Node.js
1,054 lines (873 loc) • 302 kB
TypeScript
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import type {protobuf as $protobuf} from "google-gax";
import Long = require("long");
/** Namespace smartspeech. */
export namespace smartspeech {
/** Namespace synthesis. */
namespace synthesis {
/** Namespace v1. */
namespace v1 {
/** Represents a SmartSpeech */
class SmartSpeech extends $protobuf.rpc.Service {
/**
* Constructs a new SmartSpeech service.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
*/
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
/**
* Creates new SmartSpeech service using the specified rpc implementation.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
* @returns RPC service. Useful where requests and/or responses are streamed.
*/
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SmartSpeech;
/**
* Calls Synthesize.
* @param request SynthesisRequest message or plain object
* @param callback Node-style callback called with the error, if any, and SynthesisResponse
*/
public synthesize(request: smartspeech.synthesis.v1.ISynthesisRequest, callback: smartspeech.synthesis.v1.SmartSpeech.SynthesizeCallback): void;
/**
* Calls Synthesize.
* @param request SynthesisRequest message or plain object
* @returns Promise
*/
public synthesize(request: smartspeech.synthesis.v1.ISynthesisRequest): Promise<smartspeech.synthesis.v1.SynthesisResponse>;
/**
* Calls AsyncSynthesize.
* @param request AsyncSynthesisRequest message or plain object
* @param callback Node-style callback called with the error, if any, and Task
*/
public asyncSynthesize(request: smartspeech.synthesis.v1.IAsyncSynthesisRequest, callback: smartspeech.synthesis.v1.SmartSpeech.AsyncSynthesizeCallback): void;
/**
* Calls AsyncSynthesize.
* @param request AsyncSynthesisRequest message or plain object
* @returns Promise
*/
public asyncSynthesize(request: smartspeech.synthesis.v1.IAsyncSynthesisRequest): Promise<smartspeech.task.v1.Task>;
}
namespace SmartSpeech {
/**
* Callback as used by {@link smartspeech.synthesis.v1.SmartSpeech|synthesize}.
* @param error Error, if any
* @param [response] SynthesisResponse
*/
type SynthesizeCallback = (error: (Error|null), response?: smartspeech.synthesis.v1.SynthesisResponse) => void;
/**
* Callback as used by {@link smartspeech.synthesis.v1.SmartSpeech|asyncSynthesize}.
* @param error Error, if any
* @param [response] Task
*/
type AsyncSynthesizeCallback = (error: (Error|null), response?: smartspeech.task.v1.Task) => void;
}
/** Properties of a SynthesisRequest. */
interface ISynthesisRequest {
/** SynthesisRequest text */
text?: (string|null);
/** SynthesisRequest audioEncoding */
audioEncoding?: (smartspeech.synthesis.v1.SynthesisRequest.AudioEncoding|keyof typeof smartspeech.synthesis.v1.SynthesisRequest.AudioEncoding|null);
/** SynthesisRequest language */
language?: (string|null);
/** SynthesisRequest contentType */
contentType?: (smartspeech.synthesis.v1.SynthesisRequest.ContentType|keyof typeof smartspeech.synthesis.v1.SynthesisRequest.ContentType|null);
/** SynthesisRequest voice */
voice?: (string|null);
/** SynthesisRequest rebuildCache */
rebuildCache?: (boolean|null);
}
/** Represents a SynthesisRequest. */
class SynthesisRequest implements ISynthesisRequest {
/**
* Constructs a new SynthesisRequest.
* @param [properties] Properties to set
*/
constructor(properties?: smartspeech.synthesis.v1.ISynthesisRequest);
/** SynthesisRequest text. */
public text: string;
/** SynthesisRequest audioEncoding. */
public audioEncoding: (smartspeech.synthesis.v1.SynthesisRequest.AudioEncoding|keyof typeof smartspeech.synthesis.v1.SynthesisRequest.AudioEncoding);
/** SynthesisRequest language. */
public language: string;
/** SynthesisRequest contentType. */
public contentType: (smartspeech.synthesis.v1.SynthesisRequest.ContentType|keyof typeof smartspeech.synthesis.v1.SynthesisRequest.ContentType);
/** SynthesisRequest voice. */
public voice: string;
/** SynthesisRequest rebuildCache. */
public rebuildCache: boolean;
/**
* Creates a new SynthesisRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns SynthesisRequest instance
*/
public static create(properties?: smartspeech.synthesis.v1.ISynthesisRequest): smartspeech.synthesis.v1.SynthesisRequest;
/**
* Encodes the specified SynthesisRequest message. Does not implicitly {@link smartspeech.synthesis.v1.SynthesisRequest.verify|verify} messages.
* @param message SynthesisRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: smartspeech.synthesis.v1.ISynthesisRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified SynthesisRequest message, length delimited. Does not implicitly {@link smartspeech.synthesis.v1.SynthesisRequest.verify|verify} messages.
* @param message SynthesisRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: smartspeech.synthesis.v1.ISynthesisRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a SynthesisRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns SynthesisRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): smartspeech.synthesis.v1.SynthesisRequest;
/**
* Decodes a SynthesisRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns SynthesisRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): smartspeech.synthesis.v1.SynthesisRequest;
/**
* Verifies a SynthesisRequest message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a SynthesisRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns SynthesisRequest
*/
public static fromObject(object: { [k: string]: any }): smartspeech.synthesis.v1.SynthesisRequest;
/**
* Creates a plain object from a SynthesisRequest message. Also converts values to other types if specified.
* @param message SynthesisRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: smartspeech.synthesis.v1.SynthesisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this SynthesisRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for SynthesisRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
namespace SynthesisRequest {
/** AudioEncoding enum. */
enum AudioEncoding {
AUDIO_ENCODING_UNSPECIFIED = 0,
PCM_S16LE = 1,
OPUS = 2,
WAV = 3
}
/** ContentType enum. */
enum ContentType {
TEXT = 0,
SSML = 1
}
}
/** Properties of a SynthesisResponse. */
interface ISynthesisResponse {
/** SynthesisResponse data */
data?: (Uint8Array|Buffer|string|null);
/** SynthesisResponse audioDuration */
audioDuration?: (google.protobuf.IDuration|null);
}
/** Represents a SynthesisResponse. */
class SynthesisResponse implements ISynthesisResponse {
/**
* Constructs a new SynthesisResponse.
* @param [properties] Properties to set
*/
constructor(properties?: smartspeech.synthesis.v1.ISynthesisResponse);
/** SynthesisResponse data. */
public data: (Uint8Array|Buffer|string);
/** SynthesisResponse audioDuration. */
public audioDuration?: (google.protobuf.IDuration|null);
/**
* Creates a new SynthesisResponse instance using the specified properties.
* @param [properties] Properties to set
* @returns SynthesisResponse instance
*/
public static create(properties?: smartspeech.synthesis.v1.ISynthesisResponse): smartspeech.synthesis.v1.SynthesisResponse;
/**
* Encodes the specified SynthesisResponse message. Does not implicitly {@link smartspeech.synthesis.v1.SynthesisResponse.verify|verify} messages.
* @param message SynthesisResponse message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: smartspeech.synthesis.v1.ISynthesisResponse, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified SynthesisResponse message, length delimited. Does not implicitly {@link smartspeech.synthesis.v1.SynthesisResponse.verify|verify} messages.
* @param message SynthesisResponse message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: smartspeech.synthesis.v1.ISynthesisResponse, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a SynthesisResponse message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns SynthesisResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): smartspeech.synthesis.v1.SynthesisResponse;
/**
* Decodes a SynthesisResponse message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns SynthesisResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): smartspeech.synthesis.v1.SynthesisResponse;
/**
* Verifies a SynthesisResponse message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a SynthesisResponse message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns SynthesisResponse
*/
public static fromObject(object: { [k: string]: any }): smartspeech.synthesis.v1.SynthesisResponse;
/**
* Creates a plain object from a SynthesisResponse message. Also converts values to other types if specified.
* @param message SynthesisResponse
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: smartspeech.synthesis.v1.SynthesisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this SynthesisResponse to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for SynthesisResponse
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an AsyncSynthesisRequest. */
interface IAsyncSynthesisRequest {
/** AsyncSynthesisRequest requestFileId */
requestFileId?: (string|null);
/** AsyncSynthesisRequest audioEncoding */
audioEncoding?: (smartspeech.synthesis.v1.SynthesisRequest.AudioEncoding|keyof typeof smartspeech.synthesis.v1.SynthesisRequest.AudioEncoding|null);
/** AsyncSynthesisRequest voice */
voice?: (string|null);
}
/** Represents an AsyncSynthesisRequest. */
class AsyncSynthesisRequest implements IAsyncSynthesisRequest {
/**
* Constructs a new AsyncSynthesisRequest.
* @param [properties] Properties to set
*/
constructor(properties?: smartspeech.synthesis.v1.IAsyncSynthesisRequest);
/** AsyncSynthesisRequest requestFileId. */
public requestFileId: string;
/** AsyncSynthesisRequest audioEncoding. */
public audioEncoding: (smartspeech.synthesis.v1.SynthesisRequest.AudioEncoding|keyof typeof smartspeech.synthesis.v1.SynthesisRequest.AudioEncoding);
/** AsyncSynthesisRequest voice. */
public voice: string;
/**
* Creates a new AsyncSynthesisRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns AsyncSynthesisRequest instance
*/
public static create(properties?: smartspeech.synthesis.v1.IAsyncSynthesisRequest): smartspeech.synthesis.v1.AsyncSynthesisRequest;
/**
* Encodes the specified AsyncSynthesisRequest message. Does not implicitly {@link smartspeech.synthesis.v1.AsyncSynthesisRequest.verify|verify} messages.
* @param message AsyncSynthesisRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: smartspeech.synthesis.v1.IAsyncSynthesisRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified AsyncSynthesisRequest message, length delimited. Does not implicitly {@link smartspeech.synthesis.v1.AsyncSynthesisRequest.verify|verify} messages.
* @param message AsyncSynthesisRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: smartspeech.synthesis.v1.IAsyncSynthesisRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes an AsyncSynthesisRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns AsyncSynthesisRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): smartspeech.synthesis.v1.AsyncSynthesisRequest;
/**
* Decodes an AsyncSynthesisRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns AsyncSynthesisRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): smartspeech.synthesis.v1.AsyncSynthesisRequest;
/**
* Verifies an AsyncSynthesisRequest message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates an AsyncSynthesisRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns AsyncSynthesisRequest
*/
public static fromObject(object: { [k: string]: any }): smartspeech.synthesis.v1.AsyncSynthesisRequest;
/**
* Creates a plain object from an AsyncSynthesisRequest message. Also converts values to other types if specified.
* @param message AsyncSynthesisRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: smartspeech.synthesis.v1.AsyncSynthesisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this AsyncSynthesisRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for AsyncSynthesisRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
}
}
/** Namespace task. */
namespace task {
/** Namespace v1. */
namespace v1 {
/** Represents a SmartSpeech */
class SmartSpeech extends $protobuf.rpc.Service {
/**
* Constructs a new SmartSpeech service.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
*/
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
/**
* Creates new SmartSpeech service using the specified rpc implementation.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
* @returns RPC service. Useful where requests and/or responses are streamed.
*/
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SmartSpeech;
/**
* Calls GetTask.
* @param request GetTaskRequest message or plain object
* @param callback Node-style callback called with the error, if any, and Task
*/
public getTask(request: smartspeech.task.v1.IGetTaskRequest, callback: smartspeech.task.v1.SmartSpeech.GetTaskCallback): void;
/**
* Calls GetTask.
* @param request GetTaskRequest message or plain object
* @returns Promise
*/
public getTask(request: smartspeech.task.v1.IGetTaskRequest): Promise<smartspeech.task.v1.Task>;
/**
* Calls CancelTask.
* @param request CancelTaskRequest message or plain object
* @param callback Node-style callback called with the error, if any, and Task
*/
public cancelTask(request: smartspeech.task.v1.ICancelTaskRequest, callback: smartspeech.task.v1.SmartSpeech.CancelTaskCallback): void;
/**
* Calls CancelTask.
* @param request CancelTaskRequest message or plain object
* @returns Promise
*/
public cancelTask(request: smartspeech.task.v1.ICancelTaskRequest): Promise<smartspeech.task.v1.Task>;
}
namespace SmartSpeech {
/**
* Callback as used by {@link smartspeech.task.v1.SmartSpeech|getTask}.
* @param error Error, if any
* @param [response] Task
*/
type GetTaskCallback = (error: (Error|null), response?: smartspeech.task.v1.Task) => void;
/**
* Callback as used by {@link smartspeech.task.v1.SmartSpeech|cancelTask}.
* @param error Error, if any
* @param [response] Task
*/
type CancelTaskCallback = (error: (Error|null), response?: smartspeech.task.v1.Task) => void;
}
/** Properties of a GetTaskRequest. */
interface IGetTaskRequest {
/** GetTaskRequest taskId */
taskId?: (string|null);
}
/** Represents a GetTaskRequest. */
class GetTaskRequest implements IGetTaskRequest {
/**
* Constructs a new GetTaskRequest.
* @param [properties] Properties to set
*/
constructor(properties?: smartspeech.task.v1.IGetTaskRequest);
/** GetTaskRequest taskId. */
public taskId: string;
/**
* Creates a new GetTaskRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns GetTaskRequest instance
*/
public static create(properties?: smartspeech.task.v1.IGetTaskRequest): smartspeech.task.v1.GetTaskRequest;
/**
* Encodes the specified GetTaskRequest message. Does not implicitly {@link smartspeech.task.v1.GetTaskRequest.verify|verify} messages.
* @param message GetTaskRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: smartspeech.task.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link smartspeech.task.v1.GetTaskRequest.verify|verify} messages.
* @param message GetTaskRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: smartspeech.task.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a GetTaskRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns GetTaskRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): smartspeech.task.v1.GetTaskRequest;
/**
* Decodes a GetTaskRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns GetTaskRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): smartspeech.task.v1.GetTaskRequest;
/**
* Verifies a GetTaskRequest message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns GetTaskRequest
*/
public static fromObject(object: { [k: string]: any }): smartspeech.task.v1.GetTaskRequest;
/**
* Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified.
* @param message GetTaskRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: smartspeech.task.v1.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this GetTaskRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for GetTaskRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a CancelTaskRequest. */
interface ICancelTaskRequest {
/** CancelTaskRequest taskId */
taskId?: (string|null);
}
/** Represents a CancelTaskRequest. */
class CancelTaskRequest implements ICancelTaskRequest {
/**
* Constructs a new CancelTaskRequest.
* @param [properties] Properties to set
*/
constructor(properties?: smartspeech.task.v1.ICancelTaskRequest);
/** CancelTaskRequest taskId. */
public taskId: string;
/**
* Creates a new CancelTaskRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns CancelTaskRequest instance
*/
public static create(properties?: smartspeech.task.v1.ICancelTaskRequest): smartspeech.task.v1.CancelTaskRequest;
/**
* Encodes the specified CancelTaskRequest message. Does not implicitly {@link smartspeech.task.v1.CancelTaskRequest.verify|verify} messages.
* @param message CancelTaskRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: smartspeech.task.v1.ICancelTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified CancelTaskRequest message, length delimited. Does not implicitly {@link smartspeech.task.v1.CancelTaskRequest.verify|verify} messages.
* @param message CancelTaskRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: smartspeech.task.v1.ICancelTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a CancelTaskRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns CancelTaskRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): smartspeech.task.v1.CancelTaskRequest;
/**
* Decodes a CancelTaskRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns CancelTaskRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): smartspeech.task.v1.CancelTaskRequest;
/**
* Verifies a CancelTaskRequest message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a CancelTaskRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns CancelTaskRequest
*/
public static fromObject(object: { [k: string]: any }): smartspeech.task.v1.CancelTaskRequest;
/**
* Creates a plain object from a CancelTaskRequest message. Also converts values to other types if specified.
* @param message CancelTaskRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: smartspeech.task.v1.CancelTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this CancelTaskRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for CancelTaskRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a Task. */
interface ITask {
/** Task id */
id?: (string|null);
/** Task createdAt */
createdAt?: (google.protobuf.ITimestamp|null);
/** Task updatedAt */
updatedAt?: (google.protobuf.ITimestamp|null);
/** Task status */
status?: (smartspeech.task.v1.Task.Status|keyof typeof smartspeech.task.v1.Task.Status|null);
/** Task error */
error?: (string|null);
/** Task responseFileId */
responseFileId?: (string|null);
}
/** Represents a Task. */
class Task implements ITask {
/**
* Constructs a new Task.
* @param [properties] Properties to set
*/
constructor(properties?: smartspeech.task.v1.ITask);
/** Task id. */
public id: string;
/** Task createdAt. */
public createdAt?: (google.protobuf.ITimestamp|null);
/** Task updatedAt. */
public updatedAt?: (google.protobuf.ITimestamp|null);
/** Task status. */
public status: (smartspeech.task.v1.Task.Status|keyof typeof smartspeech.task.v1.Task.Status);
/** Task error. */
public error?: (string|null);
/** Task responseFileId. */
public responseFileId?: (string|null);
/** Task result. */
public result?: ("error"|"responseFileId");
/**
* Creates a new Task instance using the specified properties.
* @param [properties] Properties to set
* @returns Task instance
*/
public static create(properties?: smartspeech.task.v1.ITask): smartspeech.task.v1.Task;
/**
* Encodes the specified Task message. Does not implicitly {@link smartspeech.task.v1.Task.verify|verify} messages.
* @param message Task message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: smartspeech.task.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified Task message, length delimited. Does not implicitly {@link smartspeech.task.v1.Task.verify|verify} messages.
* @param message Task message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: smartspeech.task.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a Task message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Task
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): smartspeech.task.v1.Task;
/**
* Decodes a Task message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Task
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): smartspeech.task.v1.Task;
/**
* Verifies a Task message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a Task message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Task
*/
public static fromObject(object: { [k: string]: any }): smartspeech.task.v1.Task;
/**
* Creates a plain object from a Task message. Also converts values to other types if specified.
* @param message Task
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: smartspeech.task.v1.Task, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this Task to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for Task
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
namespace Task {
/** Status enum. */
enum Status {
UNDEFINED = 0,
NEW = 1,
RUNNING = 2,
CANCELED = 3,
DONE = 4,
ERROR = 5
}
}
}
}
}
/** Namespace google. */
export namespace google {
/** Namespace protobuf. */
namespace protobuf {
/** Properties of a Timestamp. */
interface ITimestamp {
/** Timestamp seconds */
seconds?: (number|Long|string|null);
/** Timestamp nanos */
nanos?: (number|null);
}
/** Represents a Timestamp. */
class Timestamp implements ITimestamp {
/**
* Constructs a new Timestamp.
* @param [properties] Properties to set
*/
constructor(properties?: google.protobuf.ITimestamp);
/** Timestamp seconds. */
public seconds: (number|Long|string);
/** Timestamp nanos. */
public nanos: number;
/**
* Creates a new Timestamp instance using the specified properties.
* @param [properties] Properties to set
* @returns Timestamp instance
*/
public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp;
/**
* Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
* @param message Timestamp message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
* @param message Timestamp message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a Timestamp message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Timestamp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp;
/**
* Decodes a Timestamp message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Timestamp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp;
/**
* Verifies a Timestamp message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Timestamp
*/
public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp;
/**
* Creates a plain object from a Timestamp message. Also converts values to other types if specified.
* @param message Timestamp
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this Timestamp to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for Timestamp
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a FileDescriptorSet. */
interface IFileDescriptorSet {
/** FileDescriptorSet file */
file?: (google.protobuf.IFileDescriptorProto[]|null);
}
/** Represents a FileDescriptorSet. */
class FileDescriptorSet implements IFileDescriptorSet {
/**
* Constructs a new FileDescriptorSet.
* @param [properties] Properties to set
*/
constructor(properties?: google.protobuf.IFileDescriptorSet);
/** FileDescriptorSet file. */
public file: google.protobuf.IFileDescriptorProto[];
/**
* Creates a new FileDescriptorSet instance using the specified properties.
* @param [properties] Properties to set
* @returns FileDescriptorSet instance
*/
public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet;
/**
* Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
* @param message FileDescriptorSet message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
* @param message FileDescriptorSet message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a FileDescriptorSet message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns FileDescriptorSet
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet;
/**
* Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns FileDescriptorSet
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet;
/**
* Verifies a FileDescriptorSet message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns FileDescriptorSet
*/
public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet;
/**
* Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.
* @param message FileDescriptorSet
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any };