Skip to content

Commit 532a975

Browse files
yoshi-automationJustinBeckwith
authored andcommitted
chore: update proto docs and code style (#308)
1 parent 4f65d5b commit 532a975

File tree

7 files changed

+107
-83
lines changed

7 files changed

+107
-83
lines changed

packages/google-cloud-node/protos/google/cloud/speech/v1/cloud_speech.proto

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ option java_multiple_files = true;
3131
option java_outer_classname = "SpeechProto";
3232
option java_package = "com.google.cloud.speech.v1";
3333

34-
3534
// Service that implements Google Cloud Speech API.
3635
service Speech {
3736
// Performs synchronous speech recognition: receive results after all audio
@@ -47,7 +46,8 @@ service Speech {
4746
// google.longrunning.Operations interface. Returns either an
4847
// `Operation.error` or an `Operation.response` which contains
4948
// a `LongRunningRecognizeResponse` message.
50-
rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) {
49+
rpc LongRunningRecognize(LongRunningRecognizeRequest)
50+
returns (google.longrunning.Operation) {
5151
option (google.api.http) = {
5252
post: "/v1/speech:longrunningrecognize"
5353
body: "*"
@@ -56,8 +56,8 @@ service Speech {
5656

5757
// Performs bidirectional streaming speech recognition: receive results while
5858
// sending audio. This method is only available via the gRPC API (not REST).
59-
rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) {
60-
}
59+
rpc StreamingRecognize(stream StreamingRecognizeRequest)
60+
returns (stream StreamingRecognizeResponse) {}
6161
}
6262

6363
// The top-level message sent by the client for the `Recognize` method.
@@ -155,7 +155,8 @@ message RecognitionConfig {
155155
// an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the
156156
// encoding configuration must match the encoding described in the audio
157157
// header; otherwise the request returns an
158-
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
158+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error
159+
// code.
159160
enum AudioEncoding {
160161
// Not specified.
161162
ENCODING_UNSPECIFIED = 0;
@@ -203,7 +204,8 @@ message RecognitionConfig {
203204

204205
// Encoding of audio data sent in all `RecognitionAudio` messages.
205206
// This field is optional for `FLAC` and `WAV` audio files and required
206-
// for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
207+
// for all other audio formats. For details, see
208+
// [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
207209
AudioEncoding encoding = 1;
208210

209211
// Sample rate in Hertz of the audio data sent in all
@@ -212,7 +214,8 @@ message RecognitionConfig {
212214
// source to 16000 Hz. If that's not possible, use the native sample rate of
213215
// the audio source (instead of re-sampling).
214216
// This field is optional for `FLAC` and `WAV` audio files and required
215-
// for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
217+
// for all other audio formats. For details, see
218+
// [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
216219
int32 sample_rate_hertz = 2;
217220

218221
// *Optional* The number of channels in the input audio data.
@@ -341,8 +344,8 @@ message SpeechContext {
341344

342345
// Contains audio data in the encoding specified in the `RecognitionConfig`.
343346
// Either `content` or `uri` must be supplied. Supplying both or neither
344-
// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
345-
// [content limits](/speech-to-text/quotas#content).
347+
// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
348+
// See [content limits](/speech-to-text/quotas#content).
346349
message RecognitionAudio {
347350
// The audio source, which is either inline content or a Google Cloud
348351
// Storage uri.
@@ -357,8 +360,9 @@ message RecognitionAudio {
357360
// Currently, only Google Cloud Storage URIs are
358361
// supported, which must be specified in the following format:
359362
// `gs://bucket_name/object_name` (other URI formats return
360-
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
361-
// [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
363+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
364+
// For more information, see [Request
365+
// URIs](https://cloud.google.com/storage/docs/reference-uris).
362366
string uri = 2;
363367
}
364368
}
@@ -463,8 +467,8 @@ message StreamingRecognizeResponse {
463467
END_OF_SINGLE_UTTERANCE = 1;
464468
}
465469

466-
// Output only. If set, returns a [google.rpc.Status][google.rpc.Status] message that
467-
// specifies the error for the operation.
470+
// Output only. If set, returns a [google.rpc.Status][google.rpc.Status]
471+
// message that specifies the error for the operation.
468472
google.rpc.Status error = 1;
469473

470474
// Output only. This repeated list contains zero or more results that

packages/google-cloud-node/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ option java_multiple_files = true;
3131
option java_outer_classname = "SpeechProto";
3232
option java_package = "com.google.cloud.speech.v1p1beta1";
3333

34-
3534
// Service that implements Google Cloud Speech API.
3635
service Speech {
3736
// Performs synchronous speech recognition: receive results after all audio
@@ -47,7 +46,8 @@ service Speech {
4746
// google.longrunning.Operations interface. Returns either an
4847
// `Operation.error` or an `Operation.response` which contains
4948
// a `LongRunningRecognizeResponse` message.
50-
rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) {
49+
rpc LongRunningRecognize(LongRunningRecognizeRequest)
50+
returns (google.longrunning.Operation) {
5151
option (google.api.http) = {
5252
post: "/v1p1beta1/speech:longrunningrecognize"
5353
body: "*"
@@ -56,8 +56,8 @@ service Speech {
5656

5757
// Performs bidirectional streaming speech recognition: receive results while
5858
// sending audio. This method is only available via the gRPC API (not REST).
59-
rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) {
60-
}
59+
rpc StreamingRecognize(stream StreamingRecognizeRequest)
60+
returns (stream StreamingRecognizeResponse) {}
6161
}
6262

6363
// The top-level message sent by the client for the `Recognize` method.
@@ -155,7 +155,8 @@ message RecognitionConfig {
155155
// an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the
156156
// encoding configuration must match the encoding described in the audio
157157
// header; otherwise the request returns an
158-
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
158+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error
159+
// code.
159160
enum AudioEncoding {
160161
// Not specified.
161162
ENCODING_UNSPECIFIED = 0;
@@ -203,7 +204,8 @@ message RecognitionConfig {
203204

204205
// Encoding of audio data sent in all `RecognitionAudio` messages.
205206
// This field is optional for `FLAC` and `WAV` audio files and required
206-
// for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
207+
// for all other audio formats. For details, see
208+
// [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
207209
AudioEncoding encoding = 1;
208210

209211
// Sample rate in Hertz of the audio data sent in all
@@ -212,7 +214,8 @@ message RecognitionConfig {
212214
// source to 16000 Hz. If that's not possible, use the native sample rate of
213215
// the audio source (instead of re-sampling).
214216
// This field is optional for `FLAC` and `WAV` audio files and required
215-
// for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
217+
// for all other audio formats. For details, see
218+
// [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
216219
int32 sample_rate_hertz = 2;
217220

218221
// *Optional* The number of channels in the input audio data.
@@ -269,9 +272,10 @@ message RecognitionConfig {
269272
// won't be filtered out.
270273
bool profanity_filter = 5;
271274

272-
// *Optional* array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
273-
// A means to provide context to assist the speech recognition. For more
274-
// information, see [Phrase Hints](/speech-to-text/docs/basics#phrase-hints).
275+
// *Optional* array of
276+
// [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext]. A means to
277+
// provide context to assist the speech recognition. For more information, see
278+
// [Phrase Hints](/speech-to-text/docs/basics#phrase-hints).
275279
repeated SpeechContext speech_contexts = 6;
276280

277281
// *Optional* If `true`, the top result includes a list of words and
@@ -511,8 +515,8 @@ message SpeechContext {
511515

512516
// Contains audio data in the encoding specified in the `RecognitionConfig`.
513517
// Either `content` or `uri` must be supplied. Supplying both or neither
514-
// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
515-
// [content limits](/speech-to-text/quotas#content).
518+
// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
519+
// See [content limits](/speech-to-text/quotas#content).
516520
message RecognitionAudio {
517521
// The audio source, which is either inline content or a Google Cloud
518522
// Storage uri.
@@ -527,8 +531,9 @@ message RecognitionAudio {
527531
// Currently, only Google Cloud Storage URIs are
528532
// supported, which must be specified in the following format:
529533
// `gs://bucket_name/object_name` (other URI formats return
530-
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
531-
// [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
534+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
535+
// For more information, see [Request
536+
// URIs](https://cloud.google.com/storage/docs/reference-uris).
532537
string uri = 2;
533538
}
534539
}
@@ -633,8 +638,8 @@ message StreamingRecognizeResponse {
633638
END_OF_SINGLE_UTTERANCE = 1;
634639
}
635640

636-
// Output only. If set, returns a [google.rpc.Status][google.rpc.Status] message that
637-
// specifies the error for the operation.
641+
// Output only. If set, returns a [google.rpc.Status][google.rpc.Status]
642+
// message that specifies the error for the operation.
638643
google.rpc.Status error = 1;
639644

640645
// Output only. This repeated list contains zero or more results that

packages/google-cloud-node/src/v1/doc/google/cloud/speech/v1/doc_cloud_speech.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ const StreamingRecognitionConfig = {
136136
* @property {number} encoding
137137
* Encoding of audio data sent in all `RecognitionAudio` messages.
138138
* This field is optional for `FLAC` and `WAV` audio files and required
139-
* for all other audio formats. For details, see AudioEncoding.
139+
* for all other audio formats. For details, see
140+
* AudioEncoding.
140141
*
141142
* The number should be among the values of [AudioEncoding]{@link google.cloud.speech.v1.AudioEncoding}
142143
*
@@ -147,7 +148,8 @@ const StreamingRecognitionConfig = {
147148
* source to 16000 Hz. If that's not possible, use the native sample rate of
148149
* the audio source (instead of re-sampling).
149150
* This field is optional for `FLAC` and `WAV` audio files and required
150-
* for all other audio formats. For details, see AudioEncoding.
151+
* for all other audio formats. For details, see
152+
* AudioEncoding.
151153
*
152154
* @property {number} audioChannelCount
153155
* *Optional* The number of channels in the input audio data.
@@ -289,7 +291,8 @@ const RecognitionConfig = {
289291
* an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the
290292
* encoding configuration must match the encoding described in the audio
291293
* header; otherwise the request returns an
292-
* google.rpc.Code.INVALID_ARGUMENT error code.
294+
* google.rpc.Code.INVALID_ARGUMENT error
295+
* code.
293296
*
294297
* @enum {number}
295298
* @memberof google.cloud.speech.v1
@@ -380,8 +383,8 @@ const SpeechContext = {
380383
/**
381384
* Contains audio data in the encoding specified in the `RecognitionConfig`.
382385
* Either `content` or `uri` must be supplied. Supplying both or neither
383-
* returns google.rpc.Code.INVALID_ARGUMENT. See
384-
* [content limits](https://cloud.google.com/speech-to-text/quotas#content).
386+
* returns google.rpc.Code.INVALID_ARGUMENT.
387+
* See [content limits](https://cloud.google.com/speech-to-text/quotas#content).
385388
*
386389
* @property {string} content
387390
* The audio data bytes encoded as specified in
@@ -394,8 +397,9 @@ const SpeechContext = {
394397
* Currently, only Google Cloud Storage URIs are
395398
* supported, which must be specified in the following format:
396399
* `gs://bucket_name/object_name` (other URI formats return
397-
* google.rpc.Code.INVALID_ARGUMENT). For more information, see
398-
* [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
400+
* google.rpc.Code.INVALID_ARGUMENT).
401+
* For more information, see [Request
402+
* URIs](https://cloud.google.com/storage/docs/reference-uris).
399403
*
400404
* @typedef RecognitionAudio
401405
* @memberof google.cloud.speech.v1
@@ -524,8 +528,8 @@ const LongRunningRecognizeMetadata = {
524528
* one or more (repeated) `results`.
525529
*
526530
* @property {Object} error
527-
* Output only. If set, returns a google.rpc.Status message that
528-
* specifies the error for the operation.
531+
* Output only. If set, returns a google.rpc.Status
532+
* message that specifies the error for the operation.
529533
*
530534
* This object should have the same structure as [Status]{@link google.rpc.Status}
531535
*

packages/google-cloud-node/src/v1/doc/google/rpc/doc_status.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,25 @@
1616
// to be loaded as the JS file.
1717

1818
/**
19-
* The `Status` type defines a logical error model that is suitable for different
20-
* programming environments, including REST APIs and RPC APIs. It is used by
21-
* [gRPC](https://github.com/grpc). The error model is designed to be:
19+
* The `Status` type defines a logical error model that is suitable for
20+
* different programming environments, including REST APIs and RPC APIs. It is
21+
* used by [gRPC](https://github.com/grpc). The error model is designed to be:
2222
*
2323
* - Simple to use and understand for most users
2424
* - Flexible enough to meet unexpected needs
2525
*
2626
* # Overview
2727
*
28-
* The `Status` message contains three pieces of data: error code, error message,
29-
* and error details. The error code should be an enum value of
30-
* google.rpc.Code, but it may accept additional error codes if needed. The
31-
* error message should be a developer-facing English message that helps
32-
* developers *understand* and *resolve* the error. If a localized user-facing
33-
* error message is needed, put the localized message in the error details or
34-
* localize it in the client. The optional error details may contain arbitrary
35-
* information about the error. There is a predefined set of error detail types
36-
* in the package `google.rpc` that can be used for common error conditions.
28+
* The `Status` message contains three pieces of data: error code, error
29+
* message, and error details. The error code should be an enum value of
30+
* google.rpc.Code, but it may accept additional error codes
31+
* if needed. The error message should be a developer-facing English message
32+
* that helps developers *understand* and *resolve* the error. If a localized
33+
* user-facing error message is needed, put the localized message in the error
34+
* details or localize it in the client. The optional error details may contain
35+
* arbitrary information about the error. There is a predefined set of error
36+
* detail types in the package `google.rpc` that can be used for common error
37+
* conditions.
3738
*
3839
* # Language mapping
3940
*
@@ -70,12 +71,14 @@
7071
* be used directly after any stripping needed for security/privacy reasons.
7172
*
7273
* @property {number} code
73-
* The status code, which should be an enum value of google.rpc.Code.
74+
* The status code, which should be an enum value of
75+
* google.rpc.Code.
7476
*
7577
* @property {string} message
7678
* A developer-facing error message, which should be in English. Any
7779
* user-facing error message should be localized and sent in the
78-
* google.rpc.Status.details field, or localized by the client.
80+
* google.rpc.Status.details field, or localized
81+
* by the client.
7982
*
8083
* @property {Object[]} details
8184
* A list of messages that carry the error details. There is a common set of

packages/google-cloud-node/src/v1p1beta1/doc/google/cloud/speech/v1p1beta1/doc_cloud_speech.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ const StreamingRecognitionConfig = {
136136
* @property {number} encoding
137137
* Encoding of audio data sent in all `RecognitionAudio` messages.
138138
* This field is optional for `FLAC` and `WAV` audio files and required
139-
* for all other audio formats. For details, see AudioEncoding.
139+
* for all other audio formats. For details, see
140+
* AudioEncoding.
140141
*
141142
* The number should be among the values of [AudioEncoding]{@link google.cloud.speech.v1p1beta1.AudioEncoding}
142143
*
@@ -147,7 +148,8 @@ const StreamingRecognitionConfig = {
147148
* source to 16000 Hz. If that's not possible, use the native sample rate of
148149
* the audio source (instead of re-sampling).
149150
* This field is optional for `FLAC` and `WAV` audio files and required
150-
* for all other audio formats. For details, see AudioEncoding.
151+
* for all other audio formats. For details, see
152+
* AudioEncoding.
151153
*
152154
* @property {number} audioChannelCount
153155
* *Optional* The number of channels in the input audio data.
@@ -204,9 +206,10 @@ const StreamingRecognitionConfig = {
204206
* won't be filtered out.
205207
*
206208
* @property {Object[]} speechContexts
207-
* *Optional* array of SpeechContext.
208-
* A means to provide context to assist the speech recognition. For more
209-
* information, see [Phrase Hints](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints).
209+
* *Optional* array of
210+
* SpeechContext. A means to
211+
* provide context to assist the speech recognition. For more information, see
212+
* [Phrase Hints](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints).
210213
*
211214
* This object should have the same structure as [SpeechContext]{@link google.cloud.speech.v1p1beta1.SpeechContext}
212215
*
@@ -330,7 +333,8 @@ const RecognitionConfig = {
330333
* an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the
331334
* encoding configuration must match the encoding described in the audio
332335
* header; otherwise the request returns an
333-
* google.rpc.Code.INVALID_ARGUMENT error code.
336+
* google.rpc.Code.INVALID_ARGUMENT error
337+
* code.
334338
*
335339
* @enum {number}
336340
* @memberof google.cloud.speech.v1p1beta1
@@ -638,8 +642,8 @@ const SpeechContext = {
638642
/**
639643
* Contains audio data in the encoding specified in the `RecognitionConfig`.
640644
* Either `content` or `uri` must be supplied. Supplying both or neither
641-
* returns google.rpc.Code.INVALID_ARGUMENT. See
642-
* [content limits](https://cloud.google.com/speech-to-text/quotas#content).
645+
* returns google.rpc.Code.INVALID_ARGUMENT.
646+
* See [content limits](https://cloud.google.com/speech-to-text/quotas#content).
643647
*
644648
* @property {string} content
645649
* The audio data bytes encoded as specified in
@@ -652,8 +656,9 @@ const SpeechContext = {
652656
* Currently, only Google Cloud Storage URIs are
653657
* supported, which must be specified in the following format:
654658
* `gs://bucket_name/object_name` (other URI formats return
655-
* google.rpc.Code.INVALID_ARGUMENT). For more information, see
656-
* [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
659+
* google.rpc.Code.INVALID_ARGUMENT).
660+
* For more information, see [Request
661+
* URIs](https://cloud.google.com/storage/docs/reference-uris).
657662
*
658663
* @typedef RecognitionAudio
659664
* @memberof google.cloud.speech.v1p1beta1
@@ -782,8 +787,8 @@ const LongRunningRecognizeMetadata = {
782787
* one or more (repeated) `results`.
783788
*
784789
* @property {Object} error
785-
* Output only. If set, returns a google.rpc.Status message that
786-
* specifies the error for the operation.
790+
* Output only. If set, returns a google.rpc.Status
791+
* message that specifies the error for the operation.
787792
*
788793
* This object should have the same structure as [Status]{@link google.rpc.Status}
789794
*

0 commit comments

Comments
 (0)