Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 3737696

Browse files
fix: enable REST numeric enums (#1829)
* feat(typescript): enable REST transport To use REST transport, pass {fallback: "rest"} to the client constructor. PiperOrigin-RevId: 512747300 Source-Link: googleapis/googleapis@b0f2af1 Source-Link: googleapis/googleapis-gen@c986984 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzk4Njk4NDkwZWFiNzYwMzJkMjA2MDZlMjE0ZDMxMDM5NGU3OTMwZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): bump google-gax to ^3.5.7 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Alexander Fenster <[email protected]>
1 parent a7e4212 commit 3737696

6 files changed

Lines changed: 83 additions & 2 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Copyright 2015 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+
// http://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+
syntax = "proto3";
16+
17+
package google.api;
18+
19+
option go_package = "google.golang.org/genproto/googleapis/api;api";
20+
option java_multiple_files = true;
21+
option java_outer_classname = "LaunchStageProto";
22+
option java_package = "com.google.api";
23+
option objc_class_prefix = "GAPI";
24+
25+
// The launch stage as defined by [Google Cloud Platform
26+
// Launch Stages](https://cloud.google.com/terms/launch-stages).
27+
enum LaunchStage {
28+
// Do not use this default value.
29+
LAUNCH_STAGE_UNSPECIFIED = 0;
30+
31+
// The feature is not yet implemented. Users can not use it.
32+
UNIMPLEMENTED = 6;
33+
34+
// Prelaunch features are hidden from users and are only visible internally.
35+
PRELAUNCH = 7;
36+
37+
// Early Access features are limited to a closed group of testers. To use
38+
// these features, you must sign up in advance and sign a Trusted Tester
39+
// agreement (which includes confidentiality provisions). These features may
40+
// be unstable, changed in backward-incompatible ways, and are not
41+
// guaranteed to be released.
42+
EARLY_ACCESS = 1;
43+
44+
// Alpha is a limited availability test for releases before they are cleared
45+
// for widespread use. By Alpha, all significant design issues are resolved
46+
// and we are in the process of verifying functionality. Alpha customers
47+
// need to apply for access, agree to applicable terms, and have their
48+
// projects allowlisted. Alpha releases don't have to be feature complete,
49+
// no SLAs are provided, and there are no technical support obligations, but
50+
// they will be far enough along that customers can actually use them in
51+
// test environments or for limited-use tests -- just like they would in
52+
// normal production cases.
53+
ALPHA = 2;
54+
55+
// Beta is the point at which we are ready to open a release for any
56+
// customer to use. There are no SLA or technical support obligations in a
57+
// Beta release. Products will be complete from a feature perspective, but
58+
// may have some open outstanding issues. Beta releases are suitable for
59+
// limited production use cases.
60+
BETA = 3;
61+
62+
// GA features are open to all developers and are considered stable and
63+
// fully qualified for production use.
64+
GA = 4;
65+
66+
// Deprecated features are scheduled to be shut down and removed. For more
67+
// information, see the "Deprecation Policy" section of our [Terms of
68+
// Service](https://cloud.google.com/terms/)
69+
// and the [Google Cloud Platform Subject to the Deprecation
70+
// Policy](https://cloud.google.com/terms/deprecation) documentation.
71+
DEPRECATED = 5;
72+
}

dev/protos/google/protobuf/struct.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ message Value {
8080
// `NullValue` is a singleton enumeration to represent the null value for the
8181
// `Value` type union.
8282
//
83-
// The JSON representation for `NullValue` is JSON `null`.
83+
// The JSON representation for `NullValue` is JSON `null`.
8484
enum NullValue {
8585
// Null value.
8686
NULL_VALUE = 0;

dev/src/v1/firestore_admin_client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ export class FirestoreAdminClient {
153153
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
154154
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);
155155

156+
// Request numeric enum values if REST transport is used.
157+
opts.numericEnums = true;
158+
156159
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
157160
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
158161
opts['scopes'] = staticMembers.scopes;

dev/src/v1/firestore_client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ export class FirestoreClient {
129129
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
130130
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);
131131

132+
// Request numeric enum values if REST transport is used.
133+
opts.numericEnums = true;
134+
132135
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
133136
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
134137
opts['scopes'] = staticMembers.scopes;

dev/src/v1beta1/firestore_client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ export class FirestoreClient {
129129
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
130130
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);
131131

132+
// Request numeric enum values if REST transport is used.
133+
opts.numericEnums = true;
134+
132135
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
133136
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
134137
opts['scopes'] = staticMembers.scopes;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"dependencies": {
5757
"fast-deep-equal": "^3.1.1",
5858
"functional-red-black-tree": "^1.0.1",
59-
"google-gax": "^3.5.3",
59+
"google-gax": "^3.5.7",
6060
"protobufjs": "^7.0.0"
6161
},
6262
"devDependencies": {

0 commit comments

Comments
 (0)