diff --git a/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto b/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto index 1deb3c7cf95..5a861542fb2 100644 --- a/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto +++ b/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto @@ -650,6 +650,9 @@ message RecognizeResponse { // Sequential list of transcription results corresponding to // sequential portions of audio. repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; } // The only message returned to the client by the `LongRunningRecognize` method. @@ -662,6 +665,9 @@ message LongRunningRecognizeResponse { // sequential portions of audio. repeated SpeechRecognitionResult results = 2; + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + // Original output config if present in the request. TranscriptOutputConfig output_config = 6; @@ -768,6 +774,10 @@ message StreamingRecognizeResponse { // Indicates the type of speech event. SpeechEventType speech_event_type = 4; + + // When available, billed audio seconds for the stream. + // Set only if this is the last response in the stream. + google.protobuf.Duration total_billed_time = 5; } // A streaming speech recognition result corresponding to a portion of the audio diff --git a/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto b/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto index 16789739d6e..e3a18cf389c 100644 --- a/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto +++ b/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto @@ -135,12 +135,12 @@ message CreatePhraseSetRequest { } ]; - // The ID to use for the phrase set, which will become the final + // Required. The ID to use for the phrase set, which will become the final // component of the phrase set's resource name. // // This value should be 4-63 characters, and valid characters // are /[a-z][0-9]-/. - string phrase_set_id = 2; + string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The phrase set to create. PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; @@ -233,12 +233,12 @@ message CreateCustomClassRequest { } ]; - // The ID to use for the custom class, which will become the final + // Required. The ID to use for the custom class, which will become the final // component of the custom class' resource name. // // This value should be 4-63 characters, and valid characters // are /[a-z][0-9]-/. - string custom_class_id = 2; + string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The custom class to create. CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; diff --git a/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/resource.proto b/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/resource.proto index 74cee0647d3..731349c7ec4 100644 --- a/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/resource.proto +++ b/packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/resource.proto @@ -122,7 +122,9 @@ message SpeechAdaptation { repeated PhraseSet phrase_sets = 1; // A collection of phrase set resource names to use. - repeated string phrase_set_references = 2; + repeated string phrase_set_references = 2 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; // A collection of custom classes. To specify the classes inline, leave the // class' `name` blank and fill in the rest of its fields, giving it a unique diff --git a/packages/google-cloud-node/protos/protos.d.ts b/packages/google-cloud-node/protos/protos.d.ts index b8f925ee87b..2e838da572a 100644 --- a/packages/google-cloud-node/protos/protos.d.ts +++ b/packages/google-cloud-node/protos/protos.d.ts @@ -3277,6 +3277,9 @@ export namespace google { /** RecognizeResponse results */ results?: (google.cloud.speech.v1p1beta1.ISpeechRecognitionResult[]|null); + + /** RecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); } /** Represents a RecognizeResponse. */ @@ -3291,6 +3294,9 @@ export namespace google { /** RecognizeResponse results. */ public results: google.cloud.speech.v1p1beta1.ISpeechRecognitionResult[]; + /** RecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + /** * Creates a new RecognizeResponse instance using the specified properties. * @param [properties] Properties to set @@ -3368,6 +3374,9 @@ export namespace google { /** LongRunningRecognizeResponse results */ results?: (google.cloud.speech.v1p1beta1.ISpeechRecognitionResult[]|null); + /** LongRunningRecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + /** LongRunningRecognizeResponse outputConfig */ outputConfig?: (google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null); @@ -3387,6 +3396,9 @@ export namespace google { /** LongRunningRecognizeResponse results. */ public results: google.cloud.speech.v1p1beta1.ISpeechRecognitionResult[]; + /** LongRunningRecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + /** LongRunningRecognizeResponse outputConfig. */ public outputConfig?: (google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null); @@ -3589,6 +3601,9 @@ export namespace google { /** StreamingRecognizeResponse speechEventType */ speechEventType?: (google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|null); + + /** StreamingRecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); } /** Represents a StreamingRecognizeResponse. */ @@ -3609,6 +3624,9 @@ export namespace google { /** StreamingRecognizeResponse speechEventType. */ public speechEventType: (google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType); + /** StreamingRecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + /** * Creates a new StreamingRecognizeResponse instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-node/protos/protos.js b/packages/google-cloud-node/protos/protos.js index b69c2765432..02cfea07abe 100644 --- a/packages/google-cloud-node/protos/protos.js +++ b/packages/google-cloud-node/protos/protos.js @@ -8346,6 +8346,7 @@ * @memberof google.cloud.speech.v1p1beta1 * @interface IRecognizeResponse * @property {Array.|null} [results] RecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledTime] RecognizeResponse totalBilledTime */ /** @@ -8372,6 +8373,14 @@ */ RecognizeResponse.prototype.results = $util.emptyArray; + /** + * RecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.totalBilledTime = null; + /** * Creates a new RecognizeResponse instance using the specified properties. * @function create @@ -8399,6 +8408,8 @@ if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -8438,6 +8449,9 @@ message.results = []; message.results.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.decode(reader, reader.uint32())); break; + case 3: + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -8482,6 +8496,11 @@ return "results." + error; } } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } return null; }; @@ -8507,6 +8526,11 @@ message.results[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.fromObject(object.results[i]); } } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } return message; }; @@ -8525,11 +8549,15 @@ var object = {}; if (options.arrays || options.defaults) object.results = []; + if (options.defaults) + object.totalBilledTime = null; if (message.results && message.results.length) { object.results = []; for (var j = 0; j < message.results.length; ++j) object.results[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.toObject(message.results[j], options); } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); return object; }; @@ -8554,6 +8582,7 @@ * @memberof google.cloud.speech.v1p1beta1 * @interface ILongRunningRecognizeResponse * @property {Array.|null} [results] LongRunningRecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledTime] LongRunningRecognizeResponse totalBilledTime * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeResponse outputConfig * @property {google.rpc.IStatus|null} [outputError] LongRunningRecognizeResponse outputError */ @@ -8582,6 +8611,14 @@ */ LongRunningRecognizeResponse.prototype.results = $util.emptyArray; + /** + * LongRunningRecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.totalBilledTime = null; + /** * LongRunningRecognizeResponse outputConfig. * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig @@ -8625,6 +8662,8 @@ if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.outputError != null && Object.hasOwnProperty.call(message, "outputError")) @@ -8668,6 +8707,9 @@ message.results = []; message.results.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.decode(reader, reader.uint32())); break; + case 3: + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; case 6: message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32()); break; @@ -8718,6 +8760,11 @@ return "results." + error; } } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig); if (error) @@ -8753,6 +8800,11 @@ message.results[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.fromObject(object.results[i]); } } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } if (object.outputConfig != null) { if (typeof object.outputConfig !== "object") throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.outputConfig: object expected"); @@ -8782,6 +8834,7 @@ if (options.arrays || options.defaults) object.results = []; if (options.defaults) { + object.totalBilledTime = null; object.outputConfig = null; object.outputError = null; } @@ -8790,6 +8843,8 @@ for (var j = 0; j < message.results.length; ++j) object.results[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.toObject(message.results[j], options); } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options); if (message.outputError != null && message.hasOwnProperty("outputError")) @@ -9111,6 +9166,7 @@ * @property {google.rpc.IStatus|null} [error] StreamingRecognizeResponse error * @property {Array.|null} [results] StreamingRecognizeResponse results * @property {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType + * @property {google.protobuf.IDuration|null} [totalBilledTime] StreamingRecognizeResponse totalBilledTime */ /** @@ -9153,6 +9209,14 @@ */ StreamingRecognizeResponse.prototype.speechEventType = 0; + /** + * StreamingRecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.totalBilledTime = null; + /** * Creates a new StreamingRecognizeResponse instance using the specified properties. * @function create @@ -9184,6 +9248,8 @@ $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.speechEventType); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -9229,6 +9295,9 @@ case 4: message.speechEventType = reader.int32(); break; + case 5: + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -9286,6 +9355,11 @@ case 1: break; } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } return null; }; @@ -9326,6 +9400,11 @@ message.speechEventType = 1; break; } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } return message; }; @@ -9347,6 +9426,7 @@ if (options.defaults) { object.error = null; object.speechEventType = options.enums === String ? "SPEECH_EVENT_UNSPECIFIED" : 0; + object.totalBilledTime = null; } if (message.error != null && message.hasOwnProperty("error")) object.error = $root.google.rpc.Status.toObject(message.error, options); @@ -9357,6 +9437,8 @@ } if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) object.speechEventType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType; + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); return object; }; diff --git a/packages/google-cloud-node/protos/protos.json b/packages/google-cloud-node/protos/protos.json index 77db130b184..ac3b21a2e2a 100644 --- a/packages/google-cloud-node/protos/protos.json +++ b/packages/google-cloud-node/protos/protos.json @@ -938,6 +938,10 @@ "rule": "repeated", "type": "SpeechRecognitionResult", "id": 2 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 3 } } }, @@ -948,6 +952,10 @@ "type": "SpeechRecognitionResult", "id": 2 }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 3 + }, "outputConfig": { "type": "TranscriptOutputConfig", "id": 6 @@ -1002,6 +1010,10 @@ "speechEventType": { "type": "SpeechEventType", "id": 4 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 5 } }, "nested": { @@ -1185,7 +1197,10 @@ "phraseSetReferences": { "rule": "repeated", "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } }, "customClasses": { "rule": "repeated", @@ -1402,7 +1417,10 @@ }, "phraseSetId": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "phraseSet": { "type": "PhraseSet", @@ -1497,7 +1515,10 @@ }, "customClassId": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "customClass": { "type": "CustomClass", diff --git a/packages/google-cloud-node/src/v1p1beta1/adaptation_client.ts b/packages/google-cloud-node/src/v1p1beta1/adaptation_client.ts index aee1331fb85..46b79823a43 100644 --- a/packages/google-cloud-node/src/v1p1beta1/adaptation_client.ts +++ b/packages/google-cloud-node/src/v1p1beta1/adaptation_client.ts @@ -373,7 +373,7 @@ export class AdaptationClient { * Format: * {api_version}/projects/{project}/locations/{location}/phraseSets * @param {string} request.phraseSetId - * The ID to use for the phrase set, which will become the final + * Required. The ID to use for the phrase set, which will become the final * component of the phrase set's resource name. * * This value should be 4-63 characters, and valid characters @@ -760,7 +760,7 @@ export class AdaptationClient { * Format: * {api_version}/projects/{project}/locations/{location}/customClasses * @param {string} request.customClassId - * The ID to use for the custom class, which will become the final + * Required. The ID to use for the custom class, which will become the final * component of the custom class' resource name. * * This value should be 4-63 characters, and valid characters