Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Sep 26, 2023
1 parent d145c2a commit 3153c32
Show file tree
Hide file tree
Showing 130 changed files with 95 additions and 26,705 deletions.
14 changes: 14 additions & 0 deletions dev/protos/google/api/field_behavior.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,18 @@ enum FieldBehavior {
// a non-empty value will be returned. The user will not be aware of what
// non-empty value to expect.
NON_EMPTY_DEFAULT = 7;

// Denotes that the field in a resource (a message annotated with
// google.api.resource) is used in the resource name to uniquely identify the
// resource. For AIP-compliant APIs, this should only be applied to the
// `name` field on the resource.
//
// This behavior should not be applied to references to other resources within
// the message.
//
// The identifier field of resources often have different field behavior
// depending on the request it is embedded in (e.g. for Create methods name
// is optional and unused, while for Update methods it is required). Instead
// of method-specific annotations, only `IDENTIFIER` is required.
IDENTIFIER = 8;
}
82 changes: 62 additions & 20 deletions dev/protos/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ message FileDescriptorSet {
repeated FileDescriptorProto file = 1;
}

// The full set of known editions.
enum Edition {
// A placeholder for an unknown edition value.
EDITION_UNKNOWN = 0;

// Editions that have been released. The specific values are arbitrary and
// should not be depended on, but they will always be time-ordered for easy
// comparison.
EDITION_2023 = 1000;

// Placeholder editions for testing feature resolution. These should not be
// used or relyed on outside of tests.
EDITION_1_TEST_ONLY = 1;
EDITION_2_TEST_ONLY = 2;
EDITION_99997_TEST_ONLY = 99997;
EDITION_99998_TEST_ONLY = 99998;
EDITION_99999_TEST_ONLY = 99999;
}

// Describes a complete .proto file.
message FileDescriptorProto {
optional string name = 1; // file name, relative to root of source tree
Expand Down Expand Up @@ -90,8 +109,8 @@ message FileDescriptorProto {
// If `edition` is present, this value must be "editions".
optional string syntax = 12;

// The edition of the proto file, which is an opaque string.
optional string edition = 13;
// The edition of the proto file.
optional Edition edition = 14;
}

// Describes a message type.
Expand Down Expand Up @@ -174,7 +193,7 @@ message ExtensionRangeOptions {
}

// The verification state of the range.
// TODO(b/278783756): flip the default to DECLARATION once all empty ranges
// TODO: flip the default to DECLARATION once all empty ranges
// are marked as UNVERIFIED.
optional VerificationState verification = 3 [default = UNVERIFIED];

Expand Down Expand Up @@ -574,7 +593,7 @@ message MessageOptions {
// This should only be used as a temporary measure against broken builds due
// to the change in behavior for JSON field name conflicts.
//
// TODO(b/261750190) This is legacy behavior we plan to remove once downstream
// TODO This is legacy behavior we plan to remove once downstream
// teams have had time to migrate.
optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];

Expand Down Expand Up @@ -721,7 +740,7 @@ message FieldOptions {
repeated OptionTargetType targets = 19;

message EditionDefault {
optional string edition = 1;
optional Edition edition = 3;
optional string value = 2; // Textproto value.
}
repeated EditionDefault edition_defaults = 20;
Expand Down Expand Up @@ -768,7 +787,7 @@ message EnumOptions {
// and strips underscored from the fields before comparison in proto3 only.
// The new behavior takes `json_name` into account and applies to proto2 as
// well.
// TODO(b/261750190) Remove this legacy behavior once downstream teams have
// TODO Remove this legacy behavior once downstream teams have
// had time to migrate.
optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];

Expand Down Expand Up @@ -892,7 +911,7 @@ message UninterpretedOption {
// ===================================================================
// Features

// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are
// TODO Enums in C++ gencode (and potentially other languages) are
// not well scoped. This means that each of the feature enums below can clash
// with each other. The short names we've chosen maximize call-site
// readability, but leave us very open to this scenario. A future feature will
Expand All @@ -909,7 +928,7 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = { edition: "2023", value: "EXPLICIT" }
edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" }
];

enum EnumType {
Expand All @@ -921,7 +940,7 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
edition_defaults = { edition: "2023", value: "OPEN" }
edition_defaults = { edition: EDITION_2023, value: "OPEN" }
];

enum RepeatedFieldEncoding {
Expand All @@ -933,20 +952,19 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = { edition: "2023", value: "PACKED" }
edition_defaults = { edition: EDITION_2023, value: "PACKED" }
];

enum StringFieldValidation {
STRING_FIELD_VALIDATION_UNKNOWN = 0;
MANDATORY = 1;
HINT = 2;
NONE = 3;
enum Utf8Validation {
UTF8_VALIDATION_UNKNOWN = 0;
NONE = 1;
VERIFY = 2;
}
optional StringFieldValidation string_field_validation = 4 [
optional Utf8Validation utf8_validation = 4 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = { edition: "2023", value: "MANDATORY" }
edition_defaults = { edition: EDITION_2023, value: "VERIFY" }
];

enum MessageEncoding {
Expand All @@ -958,7 +976,7 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = { edition: "2023", value: "LENGTH_PREFIXED" }
edition_defaults = { edition: EDITION_2023, value: "LENGTH_PREFIXED" }
];

enum JsonFormat {
Expand All @@ -971,17 +989,41 @@ message FeatureSet {
targets = TARGET_TYPE_MESSAGE,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
edition_defaults = { edition: "2023", value: "ALLOW" }
edition_defaults = { edition: EDITION_2023, value: "ALLOW" }
];

optional FeatureSet raw_features = 999 [targets = TARGET_TYPE_UNKNOWN];
reserved 999;

extensions 1000; // for Protobuf C++
extensions 1001; // for Protobuf Java

extensions 9995 to 9999; // For internal testing
}

// A compiled specification for the defaults of a set of features. These
// messages are generated from FeatureSet extensions and can be used to seed
// feature resolution. The resolution with this object becomes a simple search
// for the closest matching edition, followed by proto merges.
message FeatureSetDefaults {
// A map from every known edition with a unique set of defaults to its
// defaults. Not all editions may be contained here. For a given edition,
// the defaults at the closest matching edition ordered at or before it should
// be used. This field must be in strict ascending order by edition.
message FeatureSetEditionDefault {
optional Edition edition = 3;
optional FeatureSet features = 2;
}
repeated FeatureSetEditionDefault defaults = 1;

// The minimum supported edition (inclusive) when this was constructed.
// Editions before this will not have defaults.
optional Edition minimum_edition = 4;

// The maximum known edition (inclusive) when this was constructed. Editions
// after this will not have reliable defaults.
optional Edition maximum_edition = 5;
}

// ===================================================================
// Optional source code info

Expand Down
9 changes: 4 additions & 5 deletions dev/src/v1/firestore_admin_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,15 @@ export class FirestoreAdminClient {
* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new FirestoreAdminClient({fallback: 'rest'}, gax);
* const client = new FirestoreAdminClient({fallback: true}, gax);
* ```
*/
constructor(
Expand Down Expand Up @@ -202,7 +201,7 @@ export class FirestoreAdminClient {
}
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
} else if (opts.fallback === 'rest') {
} else {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
Expand Down Expand Up @@ -256,7 +255,7 @@ export class FirestoreAdminClient {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
};
if (opts.fallback === 'rest') {
if (opts.fallback) {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
Expand Down
17 changes: 8 additions & 9 deletions dev/src/v1/firestore_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,15 @@ export class FirestoreClient {
* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new FirestoreClient({fallback: 'rest'}, gax);
* const client = new FirestoreClient({fallback: true}, gax);
* ```
*/
constructor(
Expand Down Expand Up @@ -178,7 +177,7 @@ export class FirestoreClient {
}
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
} else if (opts.fallback === 'rest') {
} else {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
Expand Down Expand Up @@ -213,23 +212,23 @@ export class FirestoreClient {
this.descriptors.stream = {
batchGetDocuments: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
runQuery: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
runAggregationQuery: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
write: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
listen: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
};

Expand Down
15 changes: 7 additions & 8 deletions dev/src/v1beta1/firestore_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,15 @@ export class FirestoreClient {
* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new FirestoreClient({fallback: 'rest'}, gax);
* const client = new FirestoreClient({fallback: true}, gax);
* ```
*/
constructor(
Expand Down Expand Up @@ -174,7 +173,7 @@ export class FirestoreClient {
}
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
} else if (opts.fallback === 'rest') {
} else {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
Expand Down Expand Up @@ -209,19 +208,19 @@ export class FirestoreClient {
this.descriptors.stream = {
batchGetDocuments: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
runQuery: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
write: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
listen: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
};

Expand Down
7 changes: 0 additions & 7 deletions owl-bot-staging/admin/v1/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions owl-bot-staging/admin/v1/.eslintrc.json

This file was deleted.

14 changes: 0 additions & 14 deletions owl-bot-staging/admin/v1/.gitignore

This file was deleted.

Loading

0 comments on commit 3153c32

Please sign in to comment.