diff --git a/protos/protos.d.ts b/protos/protos.d.ts index cd375d689..7cb0f3891 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -11351,6 +11351,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -11368,6 +11371,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -12068,6 +12074,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -12082,6 +12091,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -12160,6 +12172,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -12486,6 +12610,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -12500,6 +12627,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -12824,6 +12954,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -13205,6 +13438,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -13235,6 +13469,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -13284,6 +13521,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -13418,6 +13658,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -13459,6 +13702,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -14306,6 +14552,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -14332,6 +14581,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -15266,6 +15518,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -15321,6 +15576,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -15541,6 +15799,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -15779,6 +16152,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -15801,6 +16177,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -16390,6 +16769,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -16419,6 +16804,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -16541,6 +16932,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -16660,8 +17161,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -16676,8 +17180,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -17210,6 +17717,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { diff --git a/protos/protos.js b/protos/protos.js index beb45c490..0e183b097 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -27654,6 +27654,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -27688,6 +27689,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -27720,6 +27729,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -27771,6 +27782,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -27822,6 +27837,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -27864,6 +27884,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -27882,8 +27907,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -27891,6 +27918,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -29713,6 +29742,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -29738,6 +29768,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -29764,6 +29802,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -29804,6 +29844,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -29844,6 +29888,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -29864,6 +29913,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -29880,10 +29934,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -29913,6 +29971,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -30789,6 +31099,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -30800,6 +31111,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30814,6 +31126,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -30840,6 +31160,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -30870,7 +31193,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -30880,6 +31203,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -30920,6 +31266,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -30940,6 +31294,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -30956,10 +31317,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -31598,30 +31967,275 @@ return values; })(); - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; })(); /** @@ -32583,6 +33197,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -32597,6 +33212,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -32621,6 +33237,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -32643,6 +33260,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -32693,6 +33311,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -32814,6 +33440,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -32886,6 +33515,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -32988,6 +33623,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -33042,6 +33684,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -33094,6 +33737,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -33157,6 +33807,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -33222,6 +33876,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -33278,6 +33933,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -33326,6 +33986,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -33431,6 +34092,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -33483,6 +34152,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -33575,6 +34246,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -33688,6 +34363,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -33787,6 +34471,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -33816,6 +34520,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -33861,6 +34566,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -35905,6 +36612,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -35965,6 +36673,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -36002,6 +36718,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -36064,6 +36782,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -36132,6 +36854,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -36181,6 +36912,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -36205,6 +36956,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -36225,6 +36977,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -38543,6 +39297,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -38663,6 +39418,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -38737,6 +39500,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -38838,6 +39603,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -38973,6 +39742,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -39161,6 +39935,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -39258,6 +40037,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -39290,6 +40070,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -39562,6 +40344,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -39603,6 +40386,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -39613,93 +40400,575 @@ break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionRemoved = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionRemoved = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionRemoved = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionRemoved = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionRemoved = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionRemoved = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -40294,6 +41563,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -40337,6 +41607,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -40375,6 +41653,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -40426,6 +41706,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -40478,6 +41762,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -40511,6 +41800,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -40543,6 +41837,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -40550,6 +41845,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -41989,6 +43286,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -42054,6 +43353,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -42090,6 +43405,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -42150,6 +43469,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -42240,6 +43567,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -42379,6 +43726,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -42402,6 +43797,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -42415,6 +43812,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -42542,6 +43943,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -42726,6 +44340,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -42743,6 +44358,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -42791,6 +44407,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -42843,6 +44463,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -42951,7 +44575,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -42978,12 +44603,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -43009,10 +44642,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -43053,8 +44688,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -43097,6 +44736,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -43109,10 +44749,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -43140,6 +44785,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -43181,10 +44830,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -43203,13 +44857,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -44424,6 +46081,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Duration = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index 17de0553e..e9562c561 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -3291,8 +3291,7 @@ "java_multiple_files": true, "java_outer_classname": "ResourceProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "http": { @@ -3416,6 +3415,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -3556,6 +3559,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -3613,6 +3638,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -3674,6 +3704,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -3806,12 +3849,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -3850,6 +3900,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -3938,6 +3993,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -4163,6 +4222,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -4377,6 +4440,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -4512,7 +4576,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -4540,6 +4605,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -4609,6 +4678,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -4697,6 +4786,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -4839,6 +4932,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -4849,6 +4943,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -4859,6 +4954,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -4869,6 +4965,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -4879,7 +4976,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -4889,27 +4987,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -4954,7 +5063,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -4969,6 +5084,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -4996,11 +5138,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -5013,6 +5170,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -5098,6 +5261,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Duration": { "fields": { "seconds": { diff --git a/src/lease-manager.ts b/src/lease-manager.ts index cb55af2fe..d61998c00 100644 --- a/src/lease-manager.ts +++ b/src/lease-manager.ts @@ -15,9 +15,24 @@ */ import {EventEmitter} from 'events'; + import {AckError, Message, Subscriber} from './subscriber'; import {defaultOptions} from './default-options'; import {Duration} from './temporal'; +import {DebugMessage} from './debug'; +import {logs as baseLogs} from './logs'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + callbackDelivery: baseLogs.pubsub.sublog('callback-delivery'), + callbackExceptions: baseLogs.pubsub.sublog('callback-exceptions'), + expiry: baseLogs.pubsub.sublog('expiry'), + subscriberFlowControl: baseLogs.pubsub.sublog('subscriber-flow-control'), +}; export interface FlowControlOptions { allowExcessMessages?: boolean; @@ -106,6 +121,12 @@ export class LeaseManager extends EventEmitter { if (allowExcessMessages! || !wasFull) { this._dispense(message); } else { + if (this.pending === 0) { + logs.subscriberFlowControl.info( + 'subscriber for %s is client-side flow blocked', + this._subscriber.name, + ); + } this._pending.push(message); } @@ -125,6 +146,13 @@ export class LeaseManager extends EventEmitter { clear(): Message[] { const wasFull = this.isFull(); + if (this.pending > 0) { + logs.subscriberFlowControl.info( + 'subscriber for %s is unblocking client-side flow due to clear()', + this._subscriber.name, + ); + } + this._pending = []; const remaining = Array.from(this._messages); this._messages.clear(); @@ -173,6 +201,18 @@ export class LeaseManager extends EventEmitter { const index = this._pending.indexOf(message); this._pending.splice(index, 1); } else if (this.pending > 0) { + if (this.pending > 1) { + logs.subscriberFlowControl.info( + 'subscriber for %s dispensing one blocked message', + this._subscriber.name, + ); + } else { + logs.subscriberFlowControl.info( + 'subscriber for %s fully unblocked on client-side flow control', + this._subscriber.name, + ); + } + this._dispense(this._pending.shift()!); } @@ -225,8 +265,26 @@ export class LeaseManager extends EventEmitter { if (this._subscriber.isOpen) { message.subSpans.flowEnd(); process.nextTick(() => { + logs.callbackDelivery.info( + 'message (ID %s, ackID %s) delivery to user callbacks', + message.id, + message.ackId, + ); message.subSpans.processingStart(this._subscriber.name); - this._subscriber.emit('message', message); + try { + this._subscriber.emit('message', message); + } catch (e: unknown) { + logs.callbackExceptions.error( + 'message (ID %s, ackID %s) caused a user callback exception: %o', + message.id, + message.ackId, + e, + ); + this._subscriber.emit( + 'debug', + new DebugMessage('error during user callback', e as Error), + ); + } }); } } @@ -265,6 +323,11 @@ export class LeaseManager extends EventEmitter { message.subSpans.modAckStart(deadline, false); } } else { + logs.expiry.warn( + 'message (ID %s, ackID %s) has been dropped from leasing due to a timeout', + message.id, + message.ackId, + ); this.remove(message); } } diff --git a/src/logs.ts b/src/logs.ts new file mode 100644 index 000000000..b6c9aa68f --- /dev/null +++ b/src/logs.ts @@ -0,0 +1,24 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {loggingUtils} from 'google-gax'; + +/** + * Base logger. Other loggers will derive from this one. + * + * @private + */ +export const logs = { + pubsub: loggingUtils.log('pubsub'), +}; diff --git a/src/message-queues.ts b/src/message-queues.ts index 1788991cf..a0dcf2468 100644 --- a/src/message-queues.ts +++ b/src/message-queues.ts @@ -34,6 +34,16 @@ import {Duration} from './temporal'; import {addToBucket} from './util'; import {DebugMessage} from './debug'; import * as tracing from './telemetry-tracing'; +import {logs as baseLogs} from './logs'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + ackBatch: baseLogs.pubsub.sublog('ack-batch'), +}; export interface ReducedMessage { ackId: string; @@ -147,6 +157,8 @@ export abstract class MessageQueue { this.setOptions(options); } + protected abstract getType(): string; + /** * Shuts down this message queue gracefully. Any acks/modAcks pending in * the queue or waiting for retry will be removed. If exactly-once delivery @@ -188,6 +200,20 @@ export abstract class MessageQueue { return this._options!.maxMilliseconds!; } + /*! + * Logs about a batch being sent, and why. + * @private + */ + private logBatch(reason: string) { + logs.ackBatch.info( + '%s triggered %s batch of %i messages, a total of %i bytes', + reason, + this.getType(), + this._requests.length, + this.bytes, + ); + } + /** * Adds a message to the queue. * @@ -213,7 +239,11 @@ export abstract class MessageQueue { this._requests.length + 1 >= maxMessages! || this.bytes + size >= MAX_BATCH_BYTES ) { - await this.flush(); + const reason = + this._requests.length + 1 >= maxMessages! + ? 'going over count' + : 'going over size'; + await this.flush(reason); } // Add the message to the current batch. @@ -233,7 +263,10 @@ export abstract class MessageQueue { // Ensure that we are counting toward maxMilliseconds by timer. if (!this._timer) { - this._timer = setTimeout(() => this.flush(), maxMilliseconds!); + this._timer = setTimeout( + () => this.flush('batch timer'), + maxMilliseconds!, + ); } return responsePromise.promise; @@ -263,7 +296,7 @@ export abstract class MessageQueue { // Make sure we actually do have another batch scheduled. if (!this._timer) { this._timer = setTimeout( - () => this.flush(), + () => this.flush('retry timer'), this._options.maxMilliseconds!, ); } @@ -283,7 +316,11 @@ export abstract class MessageQueue { * Sends a batch of messages. * @private */ - async flush(): Promise { + async flush(reason?: string): Promise { + if (reason) { + this.logBatch(reason); + } + if (this._timer) { clearTimeout(this._timer); delete this._timer; @@ -493,6 +530,14 @@ export abstract class MessageQueue { * @class */ export class AckQueue extends MessageQueue { + /** + * @private + * @returns The name of the items in this queue. + */ + protected getType(): string { + return 'ack'; + } + /** * Sends a batch of ack requests. * @@ -555,6 +600,14 @@ export class AckQueue extends MessageQueue { * @class */ export class ModAckQueue extends MessageQueue { + /** + * @private + * @returns The name of the items in this queue. + */ + protected getType(): string { + return 'modack/nack'; + } + /** * Sends a batch of modAck requests. Each deadline requires its own request, * so we have to group all the ackIds by deadline and send multiple requests. diff --git a/src/message-stream.ts b/src/message-stream.ts index 0706d3b22..0c547d026 100644 --- a/src/message-stream.ts +++ b/src/message-stream.ts @@ -15,7 +15,7 @@ */ import {promisify} from '@google-cloud/promisify'; -import {ClientStub, grpc} from 'google-gax'; +import {ClientStub, GoogleError, grpc} from 'google-gax'; import * as isStreamEnded from 'is-stream-ended'; import {PassThrough} from 'stream'; @@ -26,6 +26,16 @@ import {defaultOptions} from './default-options'; import {Duration} from './temporal'; import {ExponentialRetry} from './exponential-retry'; import {DebugMessage} from './debug'; +import {logs as baseLogs} from './logs'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + subscriberStreams: baseLogs.pubsub.sublog('subscriber-streams'), +}; /*! * Frequency to ping streams. @@ -218,7 +228,7 @@ export class MessageStream extends PassThrough { for (let i = 0; i < this._streams.length; i++) { const tracker = this._streams[i]; if (tracker.stream) { - this._removeStream(i); + this._removeStream(i, 'overall message stream destroyed', 'n/a'); } } @@ -232,8 +242,12 @@ export class MessageStream extends PassThrough { * * @param {stream} stream The StreamingPull stream. */ - private _replaceStream(index: number, stream: PullStream): void { - this._removeStream(index); + private _replaceStream( + index: number, + stream: PullStream, + reason?: string, + ): void { + this._removeStream(index, reason, 'stream replacement'); this._setHighWaterMark(stream); const tracker = this._streams[index]; @@ -280,7 +294,7 @@ export class MessageStream extends PassThrough { const all: Promise[] = []; for (let i = 0; i < this._streams.length; i++) { - all.push(this._fillOne(i, client)); + all.push(this._fillOne(i, client, 'initial fill')); } await Promise.all(all); @@ -292,8 +306,14 @@ export class MessageStream extends PassThrough { } } - private async _fillOne(index: number, client?: ClientStub) { + private async _fillOne(index: number, client?: ClientStub, reason?: string) { if (this.destroyed) { + logs.subscriberStreams.info( + 'not filling stream %i for reason "%s" because already shut down', + index, + reason, + ); + return; } @@ -306,6 +326,11 @@ export class MessageStream extends PassThrough { try { client = await this._getClient(); } catch (e) { + logs.subscriberStreams.error( + 'unable to create stream %i: %o', + index, + e, + ); const err = e as Error; this.destroy(err); return; @@ -330,7 +355,7 @@ export class MessageStream extends PassThrough { }; const stream: PullStream = client.streamingPull({deadline, otherArgs}); - this._replaceStream(index, stream); + this._replaceStream(index, stream, reason); stream.write(request); } @@ -357,6 +382,10 @@ export class MessageStream extends PassThrough { * @private */ private _keepAlive(): void { + logs.subscriberStreams.info( + 'sending keepAlive to %i streams', + this._streams.length, + ); this._streams.forEach(tracker => { // It's possible that a status event fires off (signaling the rpc being // closed) but the stream hasn't drained yet. Writing to such a stream will @@ -382,32 +411,28 @@ export class MessageStream extends PassThrough { * @param {object} status The stream status. */ private _onEnd(index: number, status: grpc.StatusObject): void { - this._removeStream(index); + const willRetry = PullRetry.retry(status); + this._removeStream( + index, + 'stream was closed', + willRetry ? 'will be retried' : 'will not be retried', + ); const statusError = new StatusError(status); - - if (PullRetry.retry(status)) { - this.emit( - 'debug', - new DebugMessage( - `Subscriber stream ${index} has ended with status ${status.code}; will be retried.`, - statusError, - ), - ); + if (willRetry) { + const message = `Subscriber stream ${index} has ended with status ${status.code}; will be retried.`; + logs.subscriberStreams.info('%s', message); + this.emit('debug', new DebugMessage(message, statusError)); if (PullRetry.resetFailures(status)) { this._retrier.reset(this._streams[index]); } this._retrier.retryLater(this._streams[index], () => - this._fillOne(index), + this._fillOne(index, undefined, 'retry'), ); } else if (this._activeStreams() === 0) { - this.emit( - 'debug', - new DebugMessage( - `Subscriber stream ${index} has ended with status ${status.code}; will not be retried.`, - statusError, - ), - ); + const message = `Subscriber stream ${index} has ended with status ${status.code}; will not be retried.`; + logs.subscriberStreams.info('%s', message); + this.emit('debug', new DebugMessage(message, statusError)); // No streams left, and nothing to retry. this.destroy(new StatusError(status)); @@ -432,6 +457,12 @@ export class MessageStream extends PassThrough { const receivedStatus = !tracker.stream || (tracker.stream && !tracker.receivedStatus); + // For the user-cancelled errors, we don't need to show those, we're handling + // notifying of us closing the stream elsewhere. + if ((err as GoogleError).code !== grpc.status.CANCELLED) { + logs.subscriberStreams.error('error on stream %i: %o', index, err); + } + if (typeof code !== 'number' || !receivedStatus) { this.emit('error', err); } @@ -474,9 +505,19 @@ export class MessageStream extends PassThrough { * * @param {number} index The stream to remove. */ - private _removeStream(index: number): void { + private _removeStream( + index: number, + reason?: string, + whatNext?: string, + ): void { const tracker = this._streams[index]; if (tracker.stream) { + logs.subscriberStreams.info( + 'closing stream %i; why: %s; next: %s', + index, + reason, + whatNext, + ); tracker.stream.unpipe(this); tracker.stream.cancel(); tracker.stream = undefined; diff --git a/src/publisher/message-batch.ts b/src/publisher/message-batch.ts index 96e091bc3..4807acc4b 100644 --- a/src/publisher/message-batch.ts +++ b/src/publisher/message-batch.ts @@ -33,6 +33,7 @@ export interface BatchPublishOptions { export interface BatchResults { messages: PubsubMessage[]; callbacks: PublishCallback[]; + bytes: number; } /** @@ -101,21 +102,39 @@ export class MessageBatch { return { messages: this.messages, callbacks: this.callbacks, + bytes: this.bytes, }; } /** * Indicates if a given message can fit in the batch. * - * @param {object} message The message in question. + * @param {PubsubMessage} message The message in question. * @returns {boolean} */ canFit(message: PubsubMessage): boolean { - const {maxMessages, maxBytes} = this.options; - return ( - this.messages.length < maxMessages! && - this.bytes + calculateMessageSize(message) <= maxBytes! - ); + return this.canFitCount() && this.canFitSize(message); + } + + /** + * Indicates if a given message can fit in the batch, re: message count. + * + * @returns {boolean} + */ + canFitCount(): boolean { + const {maxMessages} = this.options; + return this.messages.length < maxMessages!; + } + + /** + * Indicates if a given message can fit in the batch, re: byte count. + * + * @param {PubsubMessage} message The message in question. + * @returns {boolean} + */ + canFitSize(message: PubsubMessage): boolean { + const {maxBytes} = this.options; + return this.bytes + calculateMessageSize(message) <= maxBytes!; } /** @@ -136,7 +155,26 @@ export class MessageBatch { * @returns {boolean} */ isFull(): boolean { - const {maxMessages, maxBytes} = this.options; - return this.messages.length >= maxMessages! || this.bytes >= maxBytes!; + return this.isFullMessages() || this.isFullSize(); + } + + /** + * True if we are full because of too many messages. + * + * @private + */ + isFullMessages(): boolean { + const {maxMessages} = this.options; + return this.messages.length >= maxMessages!; + } + + /** + * True if we are full because of too many bytes. + * + * @private + */ + isFullSize(): boolean { + const {maxBytes} = this.options; + return this.bytes >= maxBytes!; } } diff --git a/src/publisher/message-queues.ts b/src/publisher/message-queues.ts index 23f9ab8fb..2d307cea1 100644 --- a/src/publisher/message-queues.ts +++ b/src/publisher/message-queues.ts @@ -24,6 +24,16 @@ import {google} from '../../protos/protos'; import * as tracing from '../telemetry-tracing'; import {filterMessage} from './pubsub-message'; import {promisify} from 'util'; +import {logs as baseLogs} from '../logs'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + publishBatch: baseLogs.pubsub.sublog('publish-batch'), +}; /** * Queues are used to manage publishing batches of messages. @@ -71,8 +81,22 @@ export abstract class MessageQueue extends EventEmitter { * queues are ordered or not. * * @abstract + * @param {string} [reason] Optional log explanation of why the publish is happening. */ - abstract publish(): Promise; + abstract publish(reason: string): Promise; + + /*! + * Logs about a batch being sent, and why. + * @private + */ + private logBatch(reason: string, length: number, bytes: number) { + logs.publishBatch.info( + '%s triggered a publish batch of %i messages, a total of %i bytes', + reason, + length, + bytes, + ); + } /** * Method to finalize publishing. Does as many publishes as are needed @@ -87,10 +111,13 @@ export abstract class MessageQueue extends EventEmitter { * * @param {object[]} messages The messages to publish. * @param {PublishCallback[]} callbacks The corresponding callback functions. + * @private */ async _publish( messages: PubsubMessage[], callbacks: PublishCallback[], + bytes: number, + reason?: string, ): Promise { const {topic, settings} = this.publisher; const reqOpts = { @@ -121,6 +148,10 @@ export abstract class MessageQueue extends EventEmitter { 'MessageQueue._publish', ); + if (reason) { + this.logBatch(reason, messages.length, bytes); + } + const requestCallback = topic.request; const request = promisify(requestCallback.bind(topic)); try { @@ -184,21 +215,25 @@ export class Queue extends MessageQueue { // Make a background best-effort attempt to clear out the // queue. If this fails, we'll basically just be overloaded // for a bit. - this.publish().catch(() => {}); + const reason = !this.batch.canFitCount() ? 'message count' : 'byte count'; + this.publish(reason).catch(() => {}); } this.batch.add(message, callback); if (this.batch.isFull()) { // See comment above - best effort. - this.publish().catch(() => {}); + const reason = this.batch.isFullMessages() + ? 'message count' + : 'byte count'; + this.publish(reason).catch(() => {}); } else if (!this.pending) { const {maxMilliseconds} = this.batchOptions; this.pending = setTimeout(() => { // See comment above - we are basically making a best effort // to start clearing out the queue if nothing else happens // before the batch timeout. - this.publish().catch(() => {}); + this.publish('timeout').catch(() => {}); }, maxMilliseconds!); } } @@ -211,25 +246,28 @@ export class Queue extends MessageQueue { * @emits Queue#drain when all messages are sent. */ async publishDrain(): Promise { - await this._publishInternal(true); + await this._publishInternal(true, 'manual drain'); } /** * Cancels any pending publishes and calls _publish immediately. * * Does _not_ attempt to further drain after one batch is sent. + * @private */ - async publish(): Promise { - await this._publishInternal(false); + async publish(reason?: string): Promise { + await this._publishInternal(false, reason); } /** * Cancels any pending publishes and calls _publish immediately. * * @emits Queue#drain when all messages are sent. + * @private */ - async _publishInternal(fullyDrain: boolean): Promise { + async _publishInternal(fullyDrain: boolean, reason?: string): Promise { const {messages, callbacks} = this.batch.end(); + const bytes = this.batch.bytes; this.batch = new MessageBatch(this.batchOptions, this.publisher.topic.name); @@ -238,13 +276,13 @@ export class Queue extends MessageQueue { delete this.pending; } - await this._publish(messages, callbacks); + await this._publish(messages, callbacks, bytes, reason); if (this.batch.messages.length) { // We only do the indefinite go-arounds when we're trying to do a // final drain for flush(). In all other cases, we want to leave // subsequent batches alone so that they can time out as needed. if (fullyDrain) { - await this._publishInternal(true); + await this._publishInternal(true, 'message count'); } } else { this.emit('drain'); @@ -318,7 +356,10 @@ export class OrderedQueue extends MessageQueue { // Make a best-effort attempt to clear out the publish queue, // to make more space for the new batch. If this fails, we'll // just be overfilled for a bit. - this.publish().catch(() => {}); + const reason = !this.currentBatch.canFitCount() + ? 'message count' + : 'byte count'; + this.publish(reason).catch(() => {}); } this.currentBatch.add(message, callback); @@ -328,7 +369,10 @@ export class OrderedQueue extends MessageQueue { if (!this.inFlight) { if (this.currentBatch.isFull()) { // See comment above - best-effort. - this.publish().catch(() => {}); + const reason = this.currentBatch.isFullMessages() + ? 'message count' + : 'byte count'; + this.publish(reason).catch(() => {}); } else if (!this.pending) { this.beginNextPublish(); } @@ -346,7 +390,7 @@ export class OrderedQueue extends MessageQueue { // Make a best-effort attempt to start a publish request. If // this fails, we'll catch it again later, eventually, when more // messages try to enter the queue. - this.publish().catch(() => {}); + this.publish('timeout').catch(() => {}); }, delay); } /** @@ -382,7 +426,7 @@ export class OrderedQueue extends MessageQueue { * * @fires OrderedQueue#drain */ - async publish(): Promise { + async publish(reason: string): Promise { // If there's nothing to flush, don't try, just short-circuit to the drain event. // This can happen if we get a publish() call after already being drained, in // the case that topic.flush() pulls a reference to us before we get deleted. @@ -398,10 +442,10 @@ export class OrderedQueue extends MessageQueue { delete this.pending; } - const {messages, callbacks} = this.batches.pop()!.end(); + const {messages, callbacks, bytes} = this.batches.pop()!.end(); try { - await this._publish(messages, callbacks); + await this._publish(messages, callbacks, bytes, reason); } catch (e) { const err = e as ServiceError; this.inFlight = false; @@ -423,7 +467,7 @@ export class OrderedQueue extends MessageQueue { * @fires OrderedQueue#drain */ async publishDrain(): Promise { - await this.publish(); + await this.publish('manual drain'); } /** diff --git a/src/subscriber.ts b/src/subscriber.ts index 156ebfe55..74cfbdc2c 100644 --- a/src/subscriber.ts +++ b/src/subscriber.ts @@ -29,9 +29,20 @@ import {SubscriberClient} from './v1'; import * as tracing from './telemetry-tracing'; import {Duration} from './temporal'; import {EventEmitter} from 'events'; +import {logs as baseLogs} from './logs'; export {StatusError} from './message-stream'; +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + slowAck: baseLogs.pubsub.sublog('slow-ack'), + ackNack: baseLogs.pubsub.sublog('ack-nack'), +}; + export type PullResponse = google.pubsub.v1.IStreamingPullResponse; export type SubscriptionProperties = google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties; @@ -608,6 +619,10 @@ export class Subscriber extends EventEmitter { private _stream!: MessageStream; private _subscription: Subscription; + // We keep this separate from ackDeadline, because ackDeadline could + // end up being bound by min/max deadline configs. + private _99th: number; + subscriptionProperties?: SubscriptionProperties; constructor(subscription: Subscription, options = {}) { @@ -615,6 +630,7 @@ export class Subscriber extends EventEmitter { this.ackDeadline = defaultOptions.subscription.startingAckDeadline.totalOf('second'); + this._99th = this.ackDeadline; this.maxMessages = defaultOptions.subscription.maxOutstandingMessages; this.maxBytes = defaultOptions.subscription.maxOutstandingBytes; this.maxExtensionTime = defaultOptions.subscription.maxExtensionTime; @@ -647,7 +663,7 @@ export class Subscriber extends EventEmitter { // If we got an ack time reading, update the histogram (and ackDeadline). if (ackTimeSeconds) { this._histogram.add(ackTimeSeconds); - ackDeadline = this._histogram.percentile(99); + this._99th = ackDeadline = this._histogram.percentile(99); } // Grab our current min/max deadline values, based on whether exactly-once @@ -763,6 +779,21 @@ export class Subscriber extends EventEmitter { const ackTimeSeconds = (Date.now() - message.received) / 1000; this.updateAckDeadline(ackTimeSeconds); + logs.ackNack.info( + 'message (ID %s, ackID %s) ack', + message.id, + message.ackId, + ); + + if (ackTimeSeconds > this._99th) { + logs.slowAck.info( + 'message (ID %s, ackID %s) ack took longer than the 99th percentile of message processing time (%s s)', + message.id, + message.ackId, + ackTimeSeconds, + ); + } + tracing.PubsubEvents.ackStart(message); // Ignore this in this version of the method (but hook catch @@ -790,6 +821,21 @@ export class Subscriber extends EventEmitter { const ackTimeSeconds = (Date.now() - message.received) / 1000; this.updateAckDeadline(ackTimeSeconds); + logs.ackNack.info( + 'message (ID %s, ackID %s) ack with response', + message.id, + message.ackId, + ); + + if (ackTimeSeconds > this._99th) { + logs.slowAck.info( + 'message (ID %s, ackID %s) ack took longer than the 99th percentile (%s s)', + message.id, + message.ackId, + ackTimeSeconds, + ); + } + tracing.PubsubEvents.ackStart(message); await this._acks.add(message); @@ -900,6 +946,22 @@ export class Subscriber extends EventEmitter { * @private */ async nack(message: Message): Promise { + logs.ackNack.info( + 'message (ID %s, ackID %s) nack', + message.id, + message.ackId, + ); + + const nackTimeSeconds = (Date.now() - message.received) / 1000; + if (nackTimeSeconds > this._99th) { + logs.slowAck.info( + 'message (ID %s, ackID %s) nack took longer than the 99th percentile (%s s)', + message.id, + message.ackId, + nackTimeSeconds, + ); + } + message.subSpans.nackStart(); await this.modAck(message, 0); message.subSpans.nackEnd(); @@ -917,6 +979,22 @@ export class Subscriber extends EventEmitter { * @private */ async nackWithResponse(message: Message): Promise { + logs.ackNack.info( + 'message (ID %s, ackID %s) nack with response', + message.id, + message.ackId, + ); + + const nackTimeSeconds = (Date.now() - message.received) / 1000; + if (nackTimeSeconds > this._99th) { + logs.slowAck.info( + 'message (ID %s, ackID %s) nack took longer than the 99th percentile (%s s)', + message.id, + message.ackId, + nackTimeSeconds, + ); + } + message.subSpans.nackStart(); const response = await this.modAckWithResponse(message, 0); message.subSpans.nackEnd(); @@ -1102,12 +1180,12 @@ export class Subscriber extends EventEmitter { if (this._acks.numPendingRequests) { promises.push(this._acks.onFlush()); - await this._acks.flush(); + await this._acks.flush('message count'); } if (this._modAcks.numPendingRequests) { promises.push(this._modAcks.onFlush()); - await this._modAcks.flush(); + await this._modAcks.flush('message count'); } if (this._acks.numInFlightRequests) { diff --git a/test/lease-manager.ts b/test/lease-manager.ts index c95b633f9..4bfddb70a 100644 --- a/test/lease-manager.ts +++ b/test/lease-manager.ts @@ -30,8 +30,9 @@ import { Subscriber, } from '../src/subscriber'; import {defaultOptions} from '../src/default-options'; -import {TestUtils} from './test-utils'; +import {FakeLog, TestUtils} from './test-utils'; import {Duration} from '../src'; +import {loggingUtils} from 'google-gax'; const FREE_MEM = 9376387072; const fakeos = { @@ -181,6 +182,64 @@ describe('LeaseManager', () => { leaseManager.add(fakeMessage); }); + it('should make a log message about the dispatch', done => { + const fakeMessage = new FakeMessage() as {} as Message; + fakeMessage.id = 'a'; + fakeMessage.ackId = 'b'; + + const fakeLog = new FakeLog(leaseTypes.logs.callbackDelivery); + + leaseManager.setOptions({ + allowExcessMessages: true, + }); + + subscriber.on('message', () => { + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1] as string, 'a'); + assert.strictEqual(fakeLog.args![2] as string, 'b'); + done(); + }); + + leaseManager.add(fakeMessage); + }); + + it('should make a log message about a failed dispatch', async () => { + const fakeMessage = new FakeMessage() as {} as Message; + fakeMessage.id = 'a'; + fakeMessage.ackId = 'b'; + + const fakeLog = new FakeLog(leaseTypes.logs.callbackExceptions); + + leaseManager.setOptions({ + allowExcessMessages: true, + }); + + const deferred = defer(); + subscriber.on('message', () => { + process.nextTick(() => deferred.resolve()); + throw new Error('fooz'); + }); + + leaseManager.add(fakeMessage); + await deferred.promise; + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.ERROR, + ); + assert.strictEqual( + (fakeLog.args![0] as string).includes('exception'), + true, + ); + assert.strictEqual(fakeLog.args![1] as string, 'a'); + assert.strictEqual(fakeLog.args![2] as string, 'b'); + }); + it('should dispatch the message if the inventory is not full', done => { const fakeMessage = new FakeMessage() as {} as Message; @@ -209,6 +268,24 @@ describe('LeaseManager', () => { setImmediate(done); }); + it('should log if blocked by client-side flow control', () => { + const fakeMessage = new FakeMessage() as {} as Message; + + sandbox.stub(leaseManager, 'isFull').returns(true); + const pendingStub = sandbox.stub(leaseManager, 'pending'); + pendingStub.get(() => 0); + leaseManager.setOptions({allowExcessMessages: false}); + const fakeLog = new FakeLog(leaseTypes.logs.subscriberFlowControl); + + leaseManager.add(fakeMessage); + assert.strictEqual(fakeLog.called, true); + + fakeLog.called = false; + pendingStub.get(() => 1); + leaseManager.add(fakeMessage); + assert.strictEqual(fakeLog.called, false); + }); + it('should not dispatch the message if the sub closes', done => { const fakeMessage = new FakeMessage() as {} as Message; @@ -305,11 +382,18 @@ describe('LeaseManager', () => { const removeStub = sandbox.stub(leaseManager, 'remove'); const modAckStub = sandbox.stub(goodMessage, 'modAck'); + const fakeLog = new FakeLog(leaseTypes.logs.expiry); + leaseManager.add(goodMessage as {} as Message); clock.tick(halfway); // make sure the expired messages were forgotten assert.strictEqual(removeStub.callCount, badMessages.length); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.WARNING, + ); + assert.strictEqual(fakeLog.called, true); badMessages.forEach((fakeMessage, i) => { const [message] = removeStub.getCall(i).args; @@ -379,6 +463,20 @@ describe('LeaseManager', () => { setImmediate(() => leaseManager.clear()); }); + it('should log if it was full and is now empty', () => { + const fakeLog = new FakeLog(leaseTypes.logs.subscriberFlowControl); + const pendingStub = sandbox.stub(leaseManager, 'pending'); + pendingStub.get(() => 0); + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.clear(); + assert.strictEqual(fakeLog.called, false); + + pendingStub.get(() => 1); + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.clear(); + assert.strictEqual(fakeLog.called, true); + }); + it('should cancel any lease extensions', () => { const clock = TestUtils.useFakeTimers(sandbox); const stub = sandbox.stub(subscriber, 'modAck').resolves(); @@ -479,7 +577,7 @@ describe('LeaseManager', () => { setImmediate(done); }); - it('should dispense a pending messages', done => { + it('should dispense a pending message', done => { const temp = new FakeMessage() as {} as Message; const pending = new FakeMessage() as {} as Message; @@ -500,6 +598,19 @@ describe('LeaseManager', () => { leaseManager.remove(temp); }); + it('log when dispensing a pending message', () => { + const temp = new FakeMessage() as {} as Message; + const pending = new FakeMessage() as {} as Message; + + leaseManager.setOptions({allowExcessMessages: false, maxMessages: 1}); + const fakeLog = new FakeLog(leaseTypes.logs.subscriberFlowControl); + + leaseManager.add(temp); + leaseManager.add(pending); + leaseManager.remove(temp); + assert.strictEqual(fakeLog.called, true); + }); + it('should cancel any extensions if no messages are left', () => { const clock = TestUtils.useFakeTimers(sandbox); const message = new FakeMessage() as {} as Message; diff --git a/test/message-queues.ts b/test/message-queues.ts index 7dc31779a..bc88de2d5 100644 --- a/test/message-queues.ts +++ b/test/message-queues.ts @@ -17,7 +17,7 @@ import * as assert from 'assert'; import {describe, it, before, beforeEach, afterEach} from 'mocha'; import {EventEmitter} from 'events'; -import {CallOptions, GoogleError, Status} from 'google-gax'; +import {CallOptions, GoogleError, loggingUtils, Status} from 'google-gax'; import * as sinon from 'sinon'; import * as uuid from 'uuid'; import defer = require('p-defer'); @@ -26,7 +26,7 @@ import * as messageTypes from '../src/message-queues'; import {BatchError} from '../src/message-queues'; import {Message, Subscriber} from '../src/subscriber'; import {DebugMessage} from '../src/debug'; -import {TestUtils} from './test-utils'; +import {FakeLog, TestUtils} from './test-utils'; class FakeClient { async acknowledge( @@ -80,6 +80,9 @@ function fakeMessage() { class MessageQueue extends messageTypes.MessageQueue { batches: messageTypes.QueuedMessages[] = []; + protected getType(): string { + return 'test'; + } async _sendBatch( batch: messageTypes.QueuedMessages, ): Promise { @@ -211,7 +214,7 @@ describe('MessageQueues', () => { messageQueue.setOptions({maxMilliseconds: delay}); void messageQueue.add(new FakeMessage() as Message); - void messageQueue.flush(); + void messageQueue.flush('test'); clock.tick(delay); assert.strictEqual(spy.callCount, 1); @@ -219,14 +222,14 @@ describe('MessageQueues', () => { it('should remove the messages from the queue', () => { void messageQueue.add(new FakeMessage() as Message); - void messageQueue.flush(); + void messageQueue.flush('test'); assert.strictEqual(messageQueue.numPendingRequests, 0); }); it('should remove the bytes of messages from the queue', () => { void messageQueue.add(new FakeMessage() as Message); - void messageQueue.flush(); + void messageQueue.flush('test'); assert.strictEqual(messageQueue.bytes, 0); }); @@ -236,7 +239,7 @@ describe('MessageQueues', () => { const deadline = 10; void messageQueue.add(message as Message, deadline); - void messageQueue.flush(); + void messageQueue.flush('test'); const [batch] = messageQueue.batches; assert.strictEqual(batch[0].message.ackId, message.ackId); @@ -254,12 +257,12 @@ describe('MessageQueues', () => { done(); }); - void messageQueue.flush(); + void messageQueue.flush('test'); }); it('should resolve any pending promises', async () => { const promise = messageQueue.onFlush(); - setImmediate(async () => await messageQueue.flush()); + setImmediate(async () => await messageQueue.flush('test')); return promise; }); @@ -279,7 +282,7 @@ describe('MessageQueues', () => { .onDrain() .then(() => log.push('drain1')); void messageQueue.add(message as Message, deadline); - void messageQueue.flush(); + void messageQueue.flush('test'); assert.deepStrictEqual(log, ['send:start']); sendDone.resolve(); await messageQueue.onDrain().then(() => log.push('drain2')); @@ -397,12 +400,29 @@ describe('MessageQueues', () => { }; messages.forEach(message => ackQueue.add(message as Message)); - await ackQueue.flush(); + await ackQueue.flush('test'); const [reqOpts] = stub.lastCall.args; assert.deepStrictEqual(reqOpts, expectedReqOpts); }); + it('should make a log message about batch sends', async () => { + const messages = [new FakeMessage()]; + + sandbox.stub(fakeSubscriber.client, 'acknowledge').resolves(); + const fakeLog = new FakeLog(messageTypes.logs.ackBatch); + + messages.forEach(message => ackQueue.add(message as Message)); + await ackQueue.flush('logtest'); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1] as string, 'logtest'); + }); + it('should send call options', async () => { const fakeCallOptions = {timeout: 10000}; const stub = sandbox @@ -410,7 +430,7 @@ describe('MessageQueues', () => { .resolves(); ackQueue.setOptions({callOptions: fakeCallOptions}); - await ackQueue.flush(); + await ackQueue.flush('test'); const [, callOptions] = stub.lastCall.args; assert.strictEqual(callOptions, fakeCallOptions); @@ -449,7 +469,7 @@ describe('MessageQueues', () => { }); messages.forEach(message => ackQueue.add(message as Message)); - void ackQueue.flush(); + void ackQueue.flush('test'); }); // The analogous modAck version is very similar, so please sync changes. @@ -464,7 +484,7 @@ describe('MessageQueues', () => { const message = new FakeMessage() as Message; const completion = ackQueue.add(message); - await ackQueue.flush(); + await ackQueue.flush('test'); assert.strictEqual(stub.callCount, 1); await assert.doesNotReject(completion); }); @@ -484,7 +504,7 @@ describe('MessageQueues', () => { const proms = ackQueue.requests.map( (r: messageTypes.QueuedMessage) => r.responsePromise!.promise, ); - await ackQueue.flush(); + await ackQueue.flush('test'); const results = await Promise.allSettled(proms); const oneSuccess = {status: 'fulfilled', value: undefined}; assert.deepStrictEqual(results, [oneSuccess, oneSuccess, oneSuccess]); @@ -507,7 +527,7 @@ describe('MessageQueues', () => { (r: messageTypes.QueuedMessage) => r.responsePromise!.promise, ); void proms.shift(); - await ackQueue.flush(); + await ackQueue.flush('test'); const results = await Promise.allSettled(proms); assert.strictEqual(results[0].status, 'rejected'); @@ -537,7 +557,7 @@ describe('MessageQueues', () => { ackQueue.requests[0].responsePromise!.promise, ackQueue.requests[2].responsePromise!.promise, ]; - await ackQueue.flush(); + await ackQueue.flush('test'); const results = await Promise.allSettled(proms); assert.strictEqual(results[0].status, 'rejected'); @@ -571,7 +591,7 @@ describe('MessageQueues', () => { sandbox.stub(fakeSubscriber.client, 'acknowledge').rejects(fakeError); void ackQueue.add(message); - await ackQueue.flush(); + await ackQueue.flush('test'); // Make sure the one handled by errorInfo was retried. assert.strictEqual(ackQueue.numInRetryRequests, 1); @@ -593,7 +613,7 @@ describe('MessageQueues', () => { const message = new FakeMessage() as Message; const completion = ackQueue.add(message); - await ackQueue.flush(); + await ackQueue.flush('test'); assert.strictEqual(stub.callCount, 1); await completion; }); @@ -605,7 +625,7 @@ describe('MessageQueues', () => { const message = new FakeMessage() as Message; const completion = ackQueue.add(message); - await ackQueue.flush(); + await ackQueue.flush('test'); assert.strictEqual(stub.callCount, 1); await completion; }); @@ -639,12 +659,29 @@ describe('MessageQueues', () => { messages.forEach(message => modAckQueue.add(message as Message, deadline), ); - await modAckQueue.flush(); + await modAckQueue.flush('test'); const [reqOpts] = stub.lastCall.args; assert.deepStrictEqual(reqOpts, expectedReqOpts); }); + it('should make a log message about batch sends', async () => { + const messages = [new FakeMessage()]; + + sandbox.stub(fakeSubscriber.client, 'modifyAckDeadline').resolves(); + const fakeLog = new FakeLog(messageTypes.logs.ackBatch); + + messages.forEach(message => modAckQueue.add(message as Message)); + await modAckQueue.flush('logtest'); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1] as string, 'logtest'); + }); + it('should group ackIds by deadline', async () => { const deadline1 = 600; const deadline2 = 1000; @@ -682,7 +719,7 @@ describe('MessageQueues', () => { messages2.forEach(message => modAckQueue.add(message as Message, deadline2), ); - await modAckQueue.flush(); + await modAckQueue.flush('test'); const [reqOpts1] = stub.getCall(0).args; assert.deepStrictEqual(reqOpts1, expectedReqOpts1); @@ -699,7 +736,7 @@ describe('MessageQueues', () => { modAckQueue.setOptions({callOptions: fakeCallOptions}); await modAckQueue.add(new FakeMessage() as Message, 10); - await modAckQueue.flush(); + await modAckQueue.flush('test'); const [, callOptions] = stub.lastCall.args; assert.strictEqual(callOptions, fakeCallOptions); @@ -741,7 +778,7 @@ describe('MessageQueues', () => { }); messages.forEach(message => modAckQueue.add(message as Message)); - void modAckQueue.flush(); + void modAckQueue.flush('test'); }); describe('handle modAck responses when !isExactlyOnceDelivery', () => { @@ -755,7 +792,7 @@ describe('MessageQueues', () => { const message = new FakeMessage() as Message; const completion = modAckQueue.add(message); - await modAckQueue.flush(); + await modAckQueue.flush('test'); assert.strictEqual(stub.callCount, 1); await assert.doesNotReject(completion); }); @@ -775,7 +812,7 @@ describe('MessageQueues', () => { const proms = modAckQueue.requests.map( (r: messageTypes.QueuedMessage) => r.responsePromise!.promise, ); - await modAckQueue.flush(); + await modAckQueue.flush('test'); const results = await Promise.allSettled(proms); const oneSuccess = {status: 'fulfilled', value: undefined}; assert.deepStrictEqual(results, [oneSuccess, oneSuccess, oneSuccess]); @@ -800,7 +837,7 @@ describe('MessageQueues', () => { (r: messageTypes.QueuedMessage) => r.responsePromise!.promise, ); void proms.shift(); - await modAckQueue.flush(); + await modAckQueue.flush('test'); const results = await Promise.allSettled(proms); assert.strictEqual(results[0].status, 'rejected'); @@ -832,7 +869,7 @@ describe('MessageQueues', () => { modAckQueue.requests[0].responsePromise!.promise, modAckQueue.requests[2].responsePromise!.promise, ]; - await modAckQueue.flush(); + await modAckQueue.flush('test'); const results = await Promise.allSettled(proms); assert.strictEqual(results[0].status, 'rejected'); @@ -854,7 +891,7 @@ describe('MessageQueues', () => { const message = new FakeMessage() as Message; const completion = modAckQueue.add(message); - await modAckQueue.flush(); + await modAckQueue.flush('test'); assert.strictEqual(stub.callCount, 1); await completion; }); @@ -866,7 +903,7 @@ describe('MessageQueues', () => { const message = new FakeMessage() as Message; const completion = modAckQueue.add(message); - await modAckQueue.flush(); + await modAckQueue.flush('test'); assert.strictEqual(stub.callCount, 1); await completion; }); diff --git a/test/publisher/message-batch.ts b/test/publisher/message-batch.ts index f1cfe0b29..273d4fd0d 100644 --- a/test/publisher/message-batch.ts +++ b/test/publisher/message-batch.ts @@ -108,17 +108,23 @@ describe('MessageBatch', () => { batch.options.maxMessages = 0; const canFit = batch.canFit(message); assert.strictEqual(canFit, false); + assert.strictEqual(batch.canFitCount(), false); + assert.strictEqual(batch.canFitSize(message), true); }); it('should return false if too many bytes', () => { batch.options.maxBytes = messageSize - 1; const canFit = batch.canFit(message); assert.strictEqual(canFit, false); + assert.strictEqual(batch.canFitCount(), true); + assert.strictEqual(batch.canFitSize(message), false); }); it('should return true if it can fit', () => { const canFit = batch.canFit(message); assert.strictEqual(canFit, true); + assert.strictEqual(batch.canFitCount(), true); + assert.strictEqual(batch.canFitSize(message), true); }); }); @@ -175,6 +181,8 @@ describe('MessageBatch', () => { batch.add(message, sandbox.spy()); const isFull = batch.isFull(); assert.strictEqual(isFull, true); + assert.strictEqual(batch.isFullMessages(), true); + assert.strictEqual(batch.isFullSize(), false); }); it('should return true if at max byte limit', () => { @@ -182,12 +190,16 @@ describe('MessageBatch', () => { batch.add(message, sandbox.spy()); const isFull = batch.isFull(); assert.strictEqual(isFull, true); + assert.strictEqual(batch.isFullMessages(), false); + assert.strictEqual(batch.isFullSize(), true); }); it('should return false if it is not full', () => { batch.add(message, sandbox.spy()); const isFull = batch.isFull(); assert.strictEqual(isFull, false); + assert.strictEqual(batch.isFullMessages(), false); + assert.strictEqual(batch.isFullSize(), false); }); }); diff --git a/test/publisher/message-queues.ts b/test/publisher/message-queues.ts index 873e61c0e..89136b0f0 100644 --- a/test/publisher/message-queues.ts +++ b/test/publisher/message-queues.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {ServiceError} from 'google-gax'; +import {loggingUtils, ServiceError} from 'google-gax'; import * as assert from 'assert'; import {describe, it, before, beforeEach, afterEach} from 'mocha'; import {EventEmitter} from 'events'; @@ -26,7 +26,7 @@ import * as p from '../../src/publisher'; import * as b from '../../src/publisher/message-batch'; import * as q from '../../src/publisher/message-queues'; import {PublishError} from '../../src/publisher/publish-error'; -import {TestUtils} from '../test-utils'; +import {FakeLog, TestUtils} from '../test-utils'; class FakeTopic { name = 'projects/foo/topics/fake-topic'; @@ -70,12 +70,24 @@ class FakeMessageBatch { canFit(message: p.PubsubMessage): boolean { return true; } + canFitCount(): boolean { + return true; + } + canFitSize(): boolean { + return true; + } isAtMax(): boolean { return false; } isFull(): boolean { return false; } + isFullMessages(): boolean { + return false; + } + isFullSize(): boolean { + return false; + } setOptions(options: b.BatchPublishOptions) { this.options = options; } @@ -83,6 +95,7 @@ class FakeMessageBatch { return { messages: this.messages, callbacks: this.callbacks, + bytes: 0, }; } } @@ -159,7 +172,7 @@ describe('Message Queues', () => { it('should make the correct request', () => { const stub = sandbox.stub(topic, 'request'); - void queue._publish(messages, callbacks); + void queue._publish(messages, callbacks, 0, 'test'); const [{client, method, reqOpts}] = stub.lastCall.args; assert.strictEqual(client, 'PublisherClient'); @@ -167,12 +180,24 @@ describe('Message Queues', () => { assert.deepStrictEqual(reqOpts, {topic: topic.name, messages}); }); + it('should make a log message about the publish', () => { + sandbox.stub(topic, 'request'); + const fakeLog = new FakeLog(q.logs.publishBatch); + void queue._publish(messages, callbacks, 0, 'test'); + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1] as string, 'test'); + }); + it('should pass along any gax options', () => { const stub = sandbox.stub(topic, 'request'); const callOptions = {}; publisher.settings.gaxOpts = callOptions; - void queue._publish(messages, callbacks); + void queue._publish(messages, callbacks, 0, 'test'); const [{gaxOpts}] = stub.lastCall.args; assert.strictEqual(gaxOpts, callOptions); @@ -186,7 +211,7 @@ describe('Message Queues', () => { }); try { - await queue._publish(messages, callbacks); + await queue._publish(messages, callbacks, 0, 'test'); assert.strictEqual(null, error, '_publish did not throw'); } catch (e) { const err = e as ServiceError; @@ -207,7 +232,7 @@ describe('Message Queues', () => { callback(null, {messageIds}); }); - await queue._publish(messages, callbacks); + await queue._publish(messages, callbacks, 0, 'test'); callbacks.forEach((callback, i) => { const [, messageId] = callback.lastCall.args; @@ -312,7 +337,7 @@ describe('Message Queues', () => { it('should create a new batch', async () => { const oldBatch = queue.batch; - await queue.publish(); + await queue.publish('test'); assert.notStrictEqual(oldBatch, queue.batch); assert.ok(queue.batch instanceof FakeMessageBatch); @@ -325,7 +350,7 @@ describe('Message Queues', () => { const stub = sandbox.stub(global, 'clearTimeout').withArgs(fakeHandle); queue.pending = fakeHandle; - await queue.publish(); + await queue.publish('test'); assert.strictEqual(stub.callCount, 1); assert.strictEqual(queue.pending, undefined); @@ -335,7 +360,7 @@ describe('Message Queues', () => { const batch = queue.batch; const stub = sandbox.stub(queue, '_publish'); - await queue.publish(); + await queue.publish('test'); const [messages, callbacks] = stub.lastCall.args; assert.strictEqual(messages, batch.messages); @@ -392,7 +417,7 @@ describe('Message Queues', () => { queue.batch = new FakeMessageBatch(); queue.batch.messages = fakeMessages; queue.batch.callbacks = spies; - await queue.publish(); + await queue.publish('test'); assert.strictEqual(stub.callCount, 1); }); @@ -402,7 +427,7 @@ describe('Message Queues', () => { sandbox.stub(queue, '_publish').callsFake(async () => {}); queue.on('drain', spy); - void queue.publish().then(() => { + void queue.publish('test').then(() => { process.nextTick(() => { assert.strictEqual(spy.callCount, 1); done(); @@ -661,7 +686,7 @@ describe('Message Queues', () => { }); it('should set inFlight to true', () => { - void queue.publish(); + void queue.publish('test'); assert.strictEqual(queue.inFlight, true); }); @@ -670,7 +695,7 @@ describe('Message Queues', () => { const stub = sandbox.stub(global, 'clearTimeout'); queue.pending = fakeHandle; - void queue.publish(); + void queue.publish('test'); const [handle] = stub.lastCall.args; assert.strictEqual(handle, fakeHandle); @@ -680,7 +705,7 @@ describe('Message Queues', () => { it('should remove the oldest batch from the batch list', () => { const oldestBatch = queue.currentBatch; - void queue.publish(); + void queue.publish('test'); assert.notStrictEqual(queue.currentBatch, oldestBatch); }); @@ -688,7 +713,7 @@ describe('Message Queues', () => { it('should publish the batch', async () => { const stub = sandbox.stub(queue, '_publish'); - await queue.publish(); + await queue.publish('test'); const [messages, callbacks] = stub.lastCall.args; assert.strictEqual(messages, fakeMessages); @@ -698,7 +723,7 @@ describe('Message Queues', () => { it('should set inFlight to false after publishing', async () => { sandbox.stub(queue, '_publish').resolves(); - await queue.publish(); + await queue.publish('test'); assert.strictEqual(queue.inFlight, false); }); @@ -709,7 +734,7 @@ describe('Message Queues', () => { sandbox.stub(queue, '_publish').rejects(error); - await queue.publish(); + await queue.publish('test'); const [err] = stub.lastCall.args; assert.strictEqual(err, error); @@ -724,7 +749,7 @@ describe('Message Queues', () => { secondBatch.callbacks = spies; queue.batches.push(secondBatch as b.MessageBatch); - await queue.publish(); + await queue.publish('test'); assert.strictEqual(stub.callCount, 1); }); @@ -734,7 +759,7 @@ describe('Message Queues', () => { sandbox.stub(queue, '_publish').resolves(); queue.on('drain', spy); - await queue.publish(); + await queue.publish('test'); assert.strictEqual(spy.callCount, 1); }); @@ -744,8 +769,8 @@ describe('Message Queues', () => { sandbox.stub(queue, '_publish').resolves(); queue.on('drain', spy); - await queue.publish(); - await queue.publish(); + await queue.publish('test'); + await queue.publish('test'); assert.strictEqual(spy.callCount, 2); }); diff --git a/test/subscriber.ts b/test/subscriber.ts index df95cc1b9..e022e8bfa 100644 --- a/test/subscriber.ts +++ b/test/subscriber.ts @@ -36,6 +36,8 @@ import {Subscription} from '../src/subscription'; import {SpanKind} from '@opentelemetry/api'; import {Duration} from '../src'; import * as tracing from '../src/telemetry-tracing'; +import {FakeLog, TestUtils} from './test-utils'; +import {loggingUtils} from 'google-gax'; type PullResponse = google.pubsub.v1.IStreamingPullResponse; @@ -432,6 +434,37 @@ describe('Subscriber', () => { assert.strictEqual(subscriber.ackDeadline, fakeDeadline); }); + it('should log on ack completion', async () => { + const fakeLog = new FakeLog(s.logs.ackNack); + + await subscriber.ack(message); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1], message.id); + }); + + it('should log if the ack time is longer than the 99th percentile', async () => { + const histogram: FakeHistogram = stubs.get('histogram'); + TestUtils.useFakeTimers(sandbox, Date.now()); + + message.received = 0; + sandbox.stub(histogram, 'percentile').withArgs(99).returns(10); + const fakeLog = new FakeLog(s.logs.slowAck); + + await subscriber.ack(message); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1], message.id); + }); + it('should bound ack deadlines if min/max are specified', async () => { const histogram: FakeHistogram = stubs.get('histogram'); const now = Date.now(); @@ -709,6 +742,19 @@ describe('Subscriber', () => { assert.strictEqual(deadline, 0); }); + it('should log on ack completion', async () => { + const fakeLog = new FakeLog(s.logs.ackNack); + + await subscriber.nack(message); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1], message.id); + }); + it('should remove the message from the inventory', async () => { const inventory: FakeLeaseManager = stubs.get('inventory'); const stub = sandbox.stub(inventory, 'remove').withArgs(message); diff --git a/test/test-utils.ts b/test/test-utils.ts index c1eb6b4e6..a2f20946a 100644 --- a/test/test-utils.ts +++ b/test/test-utils.ts @@ -13,6 +13,7 @@ // limitations under the License. import {SinonSandbox, SinonFakeTimers} from 'sinon'; +import {loggingUtils} from 'google-gax'; type FakeTimersParam = Parameters[0]; interface FakeTimerConfig { @@ -51,3 +52,23 @@ export class TestUtils { return sandbox.useFakeTimers(config as FakeTimersParam); } } + +/** + * Wrapper to hook the output of ad-hoc loggers (loggingUtils.AdhocDebugLogFunction), + * because the sandbox will patch the wrong instance of the methods. + * + * @private + */ +export class FakeLog { + fields?: loggingUtils.LogFields; + args?: unknown[]; + called = false; + + constructor(log: loggingUtils.AdhocDebugLogFunction) { + log.on('log', (lf, a) => { + this.fields = lf; + this.args = a; + this.called = true; + }); + } +}