From a552719dfebda4c1263c352ea99bf8f9570290b7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 09:37:39 -0400 Subject: [PATCH] feat: add push config wrapper fields (#1730) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add push config wrapper fields PiperOrigin-RevId: 534994946 Source-Link: https://github.com/googleapis/googleapis/commit/64ecfebceee57a7fd22723d1b11b729270baf9c5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/03534b3dd4c926f706729d979d893458db7e174d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDM1MzRiM2RkNGM5MjZmNzA2NzI5ZDk3OWQ4OTM0NThkYjdlMTc0ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- protos/google/pubsub/v1/pubsub.proto | 25 ++ protos/protos.d.ts | 203 ++++++++++++ protos/protos.js | 457 +++++++++++++++++++++++++++ protos/protos.json | 25 ++ 4 files changed, 710 insertions(+) diff --git a/protos/google/pubsub/v1/pubsub.proto b/protos/google/pubsub/v1/pubsub.proto index 29ab6f09b..5f63854a4 100644 --- a/protos/google/pubsub/v1/pubsub.proto +++ b/protos/google/pubsub/v1/pubsub.proto @@ -903,6 +903,19 @@ message PushConfig { string audience = 2; } + // The payload to the push endpoint is in the form of the JSON representation + // of a PubsubMessage + // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + message PubsubWrapper {} + + // Sets the `data` field as the HTTP body for delivery. + message NoWrapper { + // When true, writes the Pub/Sub message metadata to + // `x-goog-pubsub-:` headers of the HTTP request. Writes the + // Pub/Sub message attributes to `:` headers of the HTTP request. + bool write_metadata = 1; + } + // A URL locating the endpoint to which messages should be pushed. // For example, a Webhook endpoint might use `https://example.com/push`. string push_endpoint = 1; @@ -940,6 +953,18 @@ message PushConfig { // `Authorization` header in the HTTP request for every pushed message. OidcToken oidc_token = 3; } + + // The format of the delivered message to the push endpoint is defined by + // the chosen wrapper. When unset, `PubsubWrapper` is used. + oneof wrapper { + // When set, the payload to the push endpoint is in the form of the JSON + // representation of a PubsubMessage + // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + PubsubWrapper pubsub_wrapper = 4; + + // When set, the payload to the push endpoint is not wrapped. + NoWrapper no_wrapper = 5; + } } // Configuration for a BigQuery subscription. diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 6c6f974ed..e466657f6 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -2906,6 +2906,12 @@ export namespace google { /** PushConfig oidcToken */ oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); + + /** PushConfig pubsubWrapper */ + pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null); + + /** PushConfig noWrapper */ + noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null); } /** Represents a PushConfig. */ @@ -2926,9 +2932,18 @@ export namespace google { /** PushConfig oidcToken. */ public oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); + /** PushConfig pubsubWrapper. */ + public pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null); + + /** PushConfig noWrapper. */ + public noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null); + /** PushConfig authenticationMethod. */ public authenticationMethod?: "oidcToken"; + /** PushConfig wrapper. */ + public wrapper?: ("pubsubWrapper"|"noWrapper"); + /** * Creates a new PushConfig instance using the specified properties. * @param [properties] Properties to set @@ -3111,6 +3126,194 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a PubsubWrapper. */ + interface IPubsubWrapper { + } + + /** Represents a PubsubWrapper. */ + class PubsubWrapper implements IPubsubWrapper { + + /** + * Constructs a new PubsubWrapper. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper); + + /** + * Creates a new PubsubWrapper instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubWrapper instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper): google.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @param message PubsubWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @param message PubsubWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubWrapper + * @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.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubWrapper + * @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.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Verifies a PubsubWrapper 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 PubsubWrapper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubWrapper + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified. + * @param message PubsubWrapper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.PubsubWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubWrapper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubWrapper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NoWrapper. */ + interface INoWrapper { + + /** NoWrapper writeMetadata */ + writeMetadata?: (boolean|null); + } + + /** Represents a NoWrapper. */ + class NoWrapper implements INoWrapper { + + /** + * Constructs a new NoWrapper. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.INoWrapper); + + /** NoWrapper writeMetadata. */ + public writeMetadata: boolean; + + /** + * Creates a new NoWrapper instance using the specified properties. + * @param [properties] Properties to set + * @returns NoWrapper instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.INoWrapper): google.pubsub.v1.PushConfig.NoWrapper; + + /** + * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @param message NoWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @param message NoWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NoWrapper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NoWrapper + * @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.pubsub.v1.PushConfig.NoWrapper; + + /** + * Decodes a NoWrapper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NoWrapper + * @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.pubsub.v1.PushConfig.NoWrapper; + + /** + * Verifies a NoWrapper 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 NoWrapper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NoWrapper + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.NoWrapper; + + /** + * Creates a plain object from a NoWrapper message. Also converts values to other types if specified. + * @param message NoWrapper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.NoWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NoWrapper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NoWrapper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a BigQueryConfig. */ diff --git a/protos/protos.js b/protos/protos.js index a6178c72b..12b95492d 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -6571,6 +6571,8 @@ * @property {string|null} [pushEndpoint] PushConfig pushEndpoint * @property {Object.|null} [attributes] PushConfig attributes * @property {google.pubsub.v1.PushConfig.IOidcToken|null} [oidcToken] PushConfig oidcToken + * @property {google.pubsub.v1.PushConfig.IPubsubWrapper|null} [pubsubWrapper] PushConfig pubsubWrapper + * @property {google.pubsub.v1.PushConfig.INoWrapper|null} [noWrapper] PushConfig noWrapper */ /** @@ -6613,6 +6615,22 @@ */ PushConfig.prototype.oidcToken = null; + /** + * PushConfig pubsubWrapper. + * @member {google.pubsub.v1.PushConfig.IPubsubWrapper|null|undefined} pubsubWrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.pubsubWrapper = null; + + /** + * PushConfig noWrapper. + * @member {google.pubsub.v1.PushConfig.INoWrapper|null|undefined} noWrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.noWrapper = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6627,6 +6645,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * PushConfig wrapper. + * @member {"pubsubWrapper"|"noWrapper"|undefined} wrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + Object.defineProperty(PushConfig.prototype, "wrapper", { + get: $util.oneOfGetter($oneOfFields = ["pubsubWrapper", "noWrapper"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new PushConfig instance using the specified properties. * @function create @@ -6658,6 +6687,10 @@ 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.attributes[keys[i]]).ldelim(); if (message.oidcToken != null && Object.hasOwnProperty.call(message, "oidcToken")) $root.google.pubsub.v1.PushConfig.OidcToken.encode(message.oidcToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pubsubWrapper != null && Object.hasOwnProperty.call(message, "pubsubWrapper")) + $root.google.pubsub.v1.PushConfig.PubsubWrapper.encode(message.pubsubWrapper, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.noWrapper != null && Object.hasOwnProperty.call(message, "noWrapper")) + $root.google.pubsub.v1.PushConfig.NoWrapper.encode(message.noWrapper, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -6723,6 +6756,14 @@ message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.decode(reader, reader.uint32()); break; } + case 4: { + message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.decode(reader, reader.uint32()); + break; + } + case 5: { + message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6778,6 +6819,24 @@ return "oidcToken." + error; } } + if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) { + properties.wrapper = 1; + { + var error = $root.google.pubsub.v1.PushConfig.PubsubWrapper.verify(message.pubsubWrapper); + if (error) + return "pubsubWrapper." + error; + } + } + if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) { + if (properties.wrapper === 1) + return "wrapper: multiple values"; + properties.wrapper = 1; + { + var error = $root.google.pubsub.v1.PushConfig.NoWrapper.verify(message.noWrapper); + if (error) + return "noWrapper." + error; + } + } return null; }; @@ -6807,6 +6866,16 @@ throw TypeError(".google.pubsub.v1.PushConfig.oidcToken: object expected"); message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.fromObject(object.oidcToken); } + if (object.pubsubWrapper != null) { + if (typeof object.pubsubWrapper !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.pubsubWrapper: object expected"); + message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.fromObject(object.pubsubWrapper); + } + if (object.noWrapper != null) { + if (typeof object.noWrapper !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.noWrapper: object expected"); + message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.fromObject(object.noWrapper); + } return message; }; @@ -6840,6 +6909,16 @@ if (options.oneofs) object.authenticationMethod = "oidcToken"; } + if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) { + object.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.toObject(message.pubsubWrapper, options); + if (options.oneofs) + object.wrapper = "pubsubWrapper"; + } + if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) { + object.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.toObject(message.noWrapper, options); + if (options.oneofs) + object.wrapper = "noWrapper"; + } return object; }; @@ -7096,6 +7175,384 @@ return OidcToken; })(); + PushConfig.PubsubWrapper = (function() { + + /** + * Properties of a PubsubWrapper. + * @memberof google.pubsub.v1.PushConfig + * @interface IPubsubWrapper + */ + + /** + * Constructs a new PubsubWrapper. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents a PubsubWrapper. + * @implements IPubsubWrapper + * @constructor + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set + */ + function PubsubWrapper(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 PubsubWrapper instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper instance + */ + PubsubWrapper.create = function create(properties) { + return new PubsubWrapper(properties); + }; + + /** + * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubWrapper.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubWrapper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubWrapper.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.PubsubWrapper(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubWrapper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubWrapper message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubWrapper.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PubsubWrapper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + */ + PubsubWrapper.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.PubsubWrapper) + return object; + return new $root.google.pubsub.v1.PushConfig.PubsubWrapper(); + }; + + /** + * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.PubsubWrapper} message PubsubWrapper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubWrapper.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PubsubWrapper to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @instance + * @returns {Object.} JSON object + */ + PubsubWrapper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubWrapper + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig.PubsubWrapper"; + }; + + return PubsubWrapper; + })(); + + PushConfig.NoWrapper = (function() { + + /** + * Properties of a NoWrapper. + * @memberof google.pubsub.v1.PushConfig + * @interface INoWrapper + * @property {boolean|null} [writeMetadata] NoWrapper writeMetadata + */ + + /** + * Constructs a new NoWrapper. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents a NoWrapper. + * @implements INoWrapper + * @constructor + * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set + */ + function NoWrapper(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]]; + } + + /** + * NoWrapper writeMetadata. + * @member {boolean} writeMetadata + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @instance + */ + NoWrapper.prototype.writeMetadata = false; + + /** + * Creates a new NoWrapper instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper instance + */ + NoWrapper.create = function create(properties) { + return new NoWrapper(properties); + }; + + /** + * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NoWrapper.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata); + return writer; + }; + + /** + * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NoWrapper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NoWrapper message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NoWrapper.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.NoWrapper(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.writeMetadata = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NoWrapper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NoWrapper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NoWrapper message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NoWrapper.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + if (typeof message.writeMetadata !== "boolean") + return "writeMetadata: boolean expected"; + return null; + }; + + /** + * Creates a NoWrapper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + */ + NoWrapper.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.NoWrapper) + return object; + var message = new $root.google.pubsub.v1.PushConfig.NoWrapper(); + if (object.writeMetadata != null) + message.writeMetadata = Boolean(object.writeMetadata); + return message; + }; + + /** + * Creates a plain object from a NoWrapper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.NoWrapper} message NoWrapper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NoWrapper.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.writeMetadata = false; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + object.writeMetadata = message.writeMetadata; + return object; + }; + + /** + * Converts this NoWrapper to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @instance + * @returns {Object.} JSON object + */ + NoWrapper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NoWrapper + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NoWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig.NoWrapper"; + }; + + return NoWrapper; + })(); + return PushConfig; })(); diff --git a/protos/protos.json b/protos/protos.json index 0e0062a42..646f8fce8 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -916,6 +916,12 @@ "oneof": [ "oidcToken" ] + }, + "wrapper": { + "oneof": [ + "pubsubWrapper", + "noWrapper" + ] } }, "fields": { @@ -931,6 +937,14 @@ "oidcToken": { "type": "OidcToken", "id": 3 + }, + "pubsubWrapper": { + "type": "PubsubWrapper", + "id": 4 + }, + "noWrapper": { + "type": "NoWrapper", + "id": 5 } }, "nested": { @@ -945,6 +959,17 @@ "id": 2 } } + }, + "PubsubWrapper": { + "fields": {} + }, + "NoWrapper": { + "fields": { + "writeMetadata": { + "type": "bool", + "id": 1 + } + } } } },