Skip to content

Commit 0132319

Browse files
feat: generated GAPIC code for v1p1beta1 (#21)
* feat: generated GAPIC code for v1p1beta1 * change version to 1.1.0
1 parent f3aea41 commit 0132319

File tree

12 files changed

+2194
-1
lines changed

12 files changed

+2194
-1
lines changed

packages/google-cloud-node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@google-cloud/speech",
33
"description": "Cloud Speech Client Library for Node.js",
4-
"version": "1.0.1",
4+
"version": "1.1.0",
55
"license": "Apache-2.0",
66
"author": "Google Inc.",
77
"engines": {

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

+455
Large diffs are not rendered by default.

packages/google-cloud-node/src/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const helpers = require('./helpers');
4141
// Import the clients for each version supported by this package.
4242
const gapic = Object.freeze({
4343
v1: require('./v1'),
44+
v1p1beta1: require('./v1p1beta1'),
4445
});
4546

4647
// Augment the SpeechClient objects with the helpers.
@@ -82,6 +83,7 @@ module.exports = gapic.v1;
8283
* @property {constructor} SpeechClient Reference to {@link v1.SpeechClient}.
8384
*/
8485
module.exports.v1 = gapic.v1;
86+
module.exports.v1p1beta1 = gapic.v1p1beta1;
8587

8688
// Alias `module.exports` as `module.exports.default`, for future-proofing.
8789
module.exports.default = Object.assign({}, module.exports);

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

+604
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
// Copyright 2018 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Note: this file is purely for documentation. Any contents are not expected
16+
// to be loaded as the JS file.
17+
18+
/**
19+
* `Any` contains an arbitrary serialized protocol buffer message along with a
20+
* URL that describes the type of the serialized message.
21+
*
22+
* Protobuf library provides support to pack/unpack Any values in the form
23+
* of utility functions or additional generated methods of the Any type.
24+
*
25+
* Example 1: Pack and unpack a message in C++.
26+
*
27+
* Foo foo = ...;
28+
* Any any;
29+
* any.PackFrom(foo);
30+
* ...
31+
* if (any.UnpackTo(&foo)) {
32+
* ...
33+
* }
34+
*
35+
* Example 2: Pack and unpack a message in Java.
36+
*
37+
* Foo foo = ...;
38+
* Any any = Any.pack(foo);
39+
* ...
40+
* if (any.is(Foo.class)) {
41+
* foo = any.unpack(Foo.class);
42+
* }
43+
*
44+
* Example 3: Pack and unpack a message in Python.
45+
*
46+
* foo = Foo(...)
47+
* any = Any()
48+
* any.Pack(foo)
49+
* ...
50+
* if any.Is(Foo.DESCRIPTOR):
51+
* any.Unpack(foo)
52+
* ...
53+
*
54+
* Example 4: Pack and unpack a message in Go
55+
*
56+
* foo := &pb.Foo{...}
57+
* any, err := ptypes.MarshalAny(foo)
58+
* ...
59+
* foo := &pb.Foo{}
60+
* if err := ptypes.UnmarshalAny(any, foo); err != nil {
61+
* ...
62+
* }
63+
*
64+
* The pack methods provided by protobuf library will by default use
65+
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
66+
* methods only use the fully qualified type name after the last '/'
67+
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
68+
* name "y.z".
69+
*
70+
*
71+
* # JSON
72+
*
73+
* The JSON representation of an `Any` value uses the regular
74+
* representation of the deserialized, embedded message, with an
75+
* additional field `@type` which contains the type URL. Example:
76+
*
77+
* package google.profile;
78+
* message Person {
79+
* string first_name = 1;
80+
* string last_name = 2;
81+
* }
82+
*
83+
* {
84+
* "@type": "type.googleapis.com/google.profile.Person",
85+
* "firstName": <string>,
86+
* "lastName": <string>
87+
* }
88+
*
89+
* If the embedded message type is well-known and has a custom JSON
90+
* representation, that representation will be embedded adding a field
91+
* `value` which holds the custom JSON in addition to the `@type`
92+
* field. Example (for message google.protobuf.Duration):
93+
*
94+
* {
95+
* "@type": "type.googleapis.com/google.protobuf.Duration",
96+
* "value": "1.212s"
97+
* }
98+
*
99+
* @property {string} typeUrl
100+
* A URL/resource name whose content describes the type of the
101+
* serialized protocol buffer message.
102+
*
103+
* For URLs which use the scheme `http`, `https`, or no scheme, the
104+
* following restrictions and interpretations apply:
105+
*
106+
* * If no scheme is provided, `https` is assumed.
107+
* * The last segment of the URL's path must represent the fully
108+
* qualified name of the type (as in `path/google.protobuf.Duration`).
109+
* The name should be in a canonical form (e.g., leading "." is
110+
* not accepted).
111+
* * An HTTP GET on the URL must yield a google.protobuf.Type
112+
* value in binary format, or produce an error.
113+
* * Applications are allowed to cache lookup results based on the
114+
* URL, or have them precompiled into a binary to avoid any
115+
* lookup. Therefore, binary compatibility needs to be preserved
116+
* on changes to types. (Use versioned type names to manage
117+
* breaking changes.)
118+
*
119+
* Schemes other than `http`, `https` (or the empty scheme) might be
120+
* used with implementation specific semantics.
121+
*
122+
* @property {string} value
123+
* Must be a valid serialized protocol buffer of the above specified type.
124+
*
125+
* @typedef Any
126+
* @memberof google.protobuf
127+
* @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto}
128+
*/
129+
var Any = {
130+
// This is for documentation. Actual contents will be loaded by gRPC.
131+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Copyright 2018 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Note: this file is purely for documentation. Any contents are not expected
16+
// to be loaded as the JS file.
17+
18+
/**
19+
* A Duration represents a signed, fixed-length span of time represented
20+
* as a count of seconds and fractions of seconds at nanosecond
21+
* resolution. It is independent of any calendar and concepts like "day"
22+
* or "month". It is related to Timestamp in that the difference between
23+
* two Timestamp values is a Duration and it can be added or subtracted
24+
* from a Timestamp. Range is approximately +-10,000 years.
25+
*
26+
* # Examples
27+
*
28+
* Example 1: Compute Duration from two Timestamps in pseudo code.
29+
*
30+
* Timestamp start = ...;
31+
* Timestamp end = ...;
32+
* Duration duration = ...;
33+
*
34+
* duration.seconds = end.seconds - start.seconds;
35+
* duration.nanos = end.nanos - start.nanos;
36+
*
37+
* if (duration.seconds < 0 && duration.nanos > 0) {
38+
* duration.seconds += 1;
39+
* duration.nanos -= 1000000000;
40+
* } else if (durations.seconds > 0 && duration.nanos < 0) {
41+
* duration.seconds -= 1;
42+
* duration.nanos += 1000000000;
43+
* }
44+
*
45+
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
46+
*
47+
* Timestamp start = ...;
48+
* Duration duration = ...;
49+
* Timestamp end = ...;
50+
*
51+
* end.seconds = start.seconds + duration.seconds;
52+
* end.nanos = start.nanos + duration.nanos;
53+
*
54+
* if (end.nanos < 0) {
55+
* end.seconds -= 1;
56+
* end.nanos += 1000000000;
57+
* } else if (end.nanos >= 1000000000) {
58+
* end.seconds += 1;
59+
* end.nanos -= 1000000000;
60+
* }
61+
*
62+
* Example 3: Compute Duration from datetime.timedelta in Python.
63+
*
64+
* td = datetime.timedelta(days=3, minutes=10)
65+
* duration = Duration()
66+
* duration.FromTimedelta(td)
67+
*
68+
* # JSON Mapping
69+
*
70+
* In JSON format, the Duration type is encoded as a string rather than an
71+
* object, where the string ends in the suffix "s" (indicating seconds) and
72+
* is preceded by the number of seconds, with nanoseconds expressed as
73+
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
74+
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
75+
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
76+
* microsecond should be expressed in JSON format as "3.000001s".
77+
*
78+
* @property {number} seconds
79+
* Signed seconds of the span of time. Must be from -315,576,000,000
80+
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
81+
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
82+
*
83+
* @property {number} nanos
84+
* Signed fractions of a second at nanosecond resolution of the span
85+
* of time. Durations less than one second are represented with a 0
86+
* `seconds` field and a positive or negative `nanos` field. For durations
87+
* of one second or more, a non-zero value for the `nanos` field must be
88+
* of the same sign as the `seconds` field. Must be from -999,999,999
89+
* to +999,999,999 inclusive.
90+
*
91+
* @typedef Duration
92+
* @memberof google.protobuf
93+
* @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto}
94+
*/
95+
var Duration = {
96+
// This is for documentation. Actual contents will be loaded by gRPC.
97+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Copyright 2018 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Note: this file is purely for documentation. Any contents are not expected
16+
// to be loaded as the JS file.
17+
18+
/**
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:
22+
*
23+
* - Simple to use and understand for most users
24+
* - Flexible enough to meet unexpected needs
25+
*
26+
* # Overview
27+
*
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.
37+
*
38+
* # Language mapping
39+
*
40+
* The `Status` message is the logical representation of the error model, but it
41+
* is not necessarily the actual wire format. When the `Status` message is
42+
* exposed in different client libraries and different wire protocols, it can be
43+
* mapped differently. For example, it will likely be mapped to some exceptions
44+
* in Java, but more likely mapped to some error codes in C.
45+
*
46+
* # Other uses
47+
*
48+
* The error model and the `Status` message can be used in a variety of
49+
* environments, either with or without APIs, to provide a
50+
* consistent developer experience across different environments.
51+
*
52+
* Example uses of this error model include:
53+
*
54+
* - Partial errors. If a service needs to return partial errors to the client,
55+
* it may embed the `Status` in the normal response to indicate the partial
56+
* errors.
57+
*
58+
* - Workflow errors. A typical workflow has multiple steps. Each step may
59+
* have a `Status` message for error reporting.
60+
*
61+
* - Batch operations. If a client uses batch request and batch response, the
62+
* `Status` message should be used directly inside batch response, one for
63+
* each error sub-response.
64+
*
65+
* - Asynchronous operations. If an API call embeds asynchronous operation
66+
* results in its response, the status of those operations should be
67+
* represented directly using the `Status` message.
68+
*
69+
* - Logging. If some API errors are stored in logs, the message `Status` could
70+
* be used directly after any stripping needed for security/privacy reasons.
71+
*
72+
* @property {number} code
73+
* The status code, which should be an enum value of google.rpc.Code.
74+
*
75+
* @property {string} message
76+
* A developer-facing error message, which should be in English. Any
77+
* user-facing error message should be localized and sent in the
78+
* google.rpc.Status.details field, or localized by the client.
79+
*
80+
* @property {Object[]} details
81+
* A list of messages that carry the error details. There is a common set of
82+
* message types for APIs to use.
83+
*
84+
* This object should have the same structure as [Any]{@link google.protobuf.Any}
85+
*
86+
* @typedef Status
87+
* @memberof google.rpc
88+
* @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto}
89+
*/
90+
var Status = {
91+
// This is for documentation. Actual contents will be loaded by gRPC.
92+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2018 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
const SpeechClient = require('./speech_client');
18+
19+
module.exports.SpeechClient = SpeechClient;

0 commit comments

Comments
 (0)