From 283607426fc5fe914bd0a2fbf2c4a83b5d0fc080 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 10:52:34 -0500 Subject: [PATCH] feat: Update osconfig v1 and v1alpha with WindowsApplication (#548) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Update osconfig v1 and v1alpha with WindowsApplication Committer: @coodie PiperOrigin-RevId: 393730900 Source-Link: https://github.com/googleapis/googleapis/commit/69fe13f7ca3ca96f34e042596c11e40bb3277924 Source-Link: https://github.com/googleapis/googleapis-gen/commit/69509318baafc42cbe4253dd9b53d56dd5a8f8ad * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/osconfig/v1/inventory.proto | 29 + .../google-cloud-asset/protos/protos.d.ts | 224 ++++++- packages/google-cloud-asset/protos/protos.js | 551 +++++++++++++++++- .../google-cloud-asset/protos/protos.json | 54 +- 4 files changed, 851 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto index ba3318e70e4e..11c998acb013 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.osconfig.v1; import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; option csharp_namespace = "Google.Cloud.OsConfig.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; @@ -152,6 +153,9 @@ message Inventory { // Details of a COS package. VersionedPackage cos_package = 8; + + // Details of a Windows Application + WindowsApplication windows_application = 9; } } @@ -247,6 +251,31 @@ message Inventory { google.protobuf.Timestamp install_time = 5; } + // Contains information about a Windows application as retrieved from the + // Windows Registry. For more information about these fields, see + // + // [Windows Installer Properties for the Uninstall + // Registry](https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key){: + // class="external" } + message WindowsApplication { + // The name of the application or product. + string display_name = 1; + + // The version of the product or application in string format. + string display_version = 2; + + // The name of the manufacturer for the product or application. + string publisher = 3; + + // The last time this product received service. The value of this property + // is replaced each time a patch is applied or removed from the product or + // the command-line option is used to repair the product. + google.type.Date install_date = 4; + + // The internet address for technical support. + string help_link = 5; + } + // Base level operating system information for the VM. OsInfo os_info = 1; diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 7fc0460681e8..d8b69b72c862 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -13427,6 +13427,9 @@ export namespace google { /** SoftwarePackage cosPackage */ cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage windowsApplication */ + windowsApplication?: (google.cloud.osconfig.v1.Inventory.IWindowsApplication|null); } /** Represents a SoftwarePackage. */ @@ -13462,8 +13465,11 @@ export namespace google { /** SoftwarePackage cosPackage. */ public cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + /** SoftwarePackage windowsApplication. */ + public windowsApplication?: (google.cloud.osconfig.v1.Inventory.IWindowsApplication|null); + /** SoftwarePackage details. */ - public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"); + public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"); /** * Creates a new SoftwarePackage instance using the specified properties. @@ -14090,6 +14096,120 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a WindowsApplication. */ + interface IWindowsApplication { + + /** WindowsApplication displayName */ + displayName?: (string|null); + + /** WindowsApplication displayVersion */ + displayVersion?: (string|null); + + /** WindowsApplication publisher */ + publisher?: (string|null); + + /** WindowsApplication installDate */ + installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink */ + helpLink?: (string|null); + } + + /** Represents a WindowsApplication. */ + class WindowsApplication implements IWindowsApplication { + + /** + * Constructs a new WindowsApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsApplication); + + /** WindowsApplication displayName. */ + public displayName: string; + + /** WindowsApplication displayVersion. */ + public displayVersion: string; + + /** WindowsApplication publisher. */ + public publisher: string; + + /** WindowsApplication installDate. */ + public installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink. */ + public helpLink: string; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsApplication instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsApplication): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsApplication + * @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.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsApplication + * @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.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Verifies a WindowsApplication 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 WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @param message WindowsApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } @@ -19244,6 +19364,108 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @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.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @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.type.Date; + + /** + * Verifies a Date 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 Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace identity. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index a0d518d21ceb..a4e23a3b7ad7 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -32930,6 +32930,7 @@ * @property {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null} [wuaPackage] SoftwarePackage wuaPackage * @property {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null} [qfePackage] SoftwarePackage qfePackage * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [cosPackage] SoftwarePackage cosPackage + * @property {google.cloud.osconfig.v1.Inventory.IWindowsApplication|null} [windowsApplication] SoftwarePackage windowsApplication */ /** @@ -33011,17 +33012,25 @@ */ SoftwarePackage.prototype.cosPackage = null; + /** + * SoftwarePackage windowsApplication. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsApplication|null|undefined} windowsApplication + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.windowsApplication = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * SoftwarePackage details. - * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|undefined} details + * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"|undefined} details * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage * @instance */ Object.defineProperty(SoftwarePackage.prototype, "details", { - get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage"]), + get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage", "windowsApplication"]), set: $util.oneOfSetter($oneOfFields) }); @@ -33065,6 +33074,8 @@ $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.encode(message.qfePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.cosPackage != null && Object.hasOwnProperty.call(message, "cosPackage")) $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.cosPackage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.windowsApplication != null && Object.hasOwnProperty.call(message, "windowsApplication")) + $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.encode(message.windowsApplication, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -33123,6 +33134,9 @@ case 8: message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); break; + case 9: + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -33237,6 +33251,16 @@ return "cosPackage." + error; } } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.verify(message.windowsApplication); + if (error) + return "windowsApplication." + error; + } + } return null; }; @@ -33292,6 +33316,11 @@ throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.cosPackage: object expected"); message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.cosPackage); } + if (object.windowsApplication != null) { + if (typeof object.windowsApplication !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.windowsApplication: object expected"); + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.fromObject(object.windowsApplication); + } return message; }; @@ -33348,6 +33377,11 @@ if (options.oneofs) object.details = "cosPackage"; } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + object.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.toObject(message.windowsApplication, options); + if (options.oneofs) + object.details = "windowsApplication"; + } return object; }; @@ -34744,6 +34778,287 @@ return WindowsQuickFixEngineeringPackage; })(); + Inventory.WindowsApplication = (function() { + + /** + * Properties of a WindowsApplication. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsApplication + * @property {string|null} [displayName] WindowsApplication displayName + * @property {string|null} [displayVersion] WindowsApplication displayVersion + * @property {string|null} [publisher] WindowsApplication publisher + * @property {google.type.IDate|null} [installDate] WindowsApplication installDate + * @property {string|null} [helpLink] WindowsApplication helpLink + */ + + /** + * Constructs a new WindowsApplication. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsApplication. + * @implements IWindowsApplication + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication=} [properties] Properties to set + */ + function WindowsApplication(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]]; + } + + /** + * WindowsApplication displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayName = ""; + + /** + * WindowsApplication displayVersion. + * @member {string} displayVersion + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayVersion = ""; + + /** + * WindowsApplication publisher. + * @member {string} publisher + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.publisher = ""; + + /** + * WindowsApplication installDate. + * @member {google.type.IDate|null|undefined} installDate + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.installDate = null; + + /** + * WindowsApplication helpLink. + * @member {string} helpLink + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.helpLink = ""; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication instance + */ + WindowsApplication.create = function create(properties) { + return new WindowsApplication(properties); + }; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.displayVersion != null && Object.hasOwnProperty.call(message, "displayVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayVersion); + if (message.publisher != null && Object.hasOwnProperty.call(message, "publisher")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publisher); + if (message.installDate != null && Object.hasOwnProperty.call(message, "installDate")) + $root.google.type.Date.encode(message.installDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.helpLink != null && Object.hasOwnProperty.call(message, "helpLink")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.helpLink); + return writer; + }; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.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.cloud.osconfig.v1.Inventory.WindowsApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + case 2: + message.displayVersion = reader.string(); + break; + case 3: + message.publisher = reader.string(); + break; + case 4: + message.installDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + case 5: + message.helpLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsApplication message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + if (!$util.isString(message.displayVersion)) + return "displayVersion: string expected"; + if (message.publisher != null && message.hasOwnProperty("publisher")) + if (!$util.isString(message.publisher)) + return "publisher: string expected"; + if (message.installDate != null && message.hasOwnProperty("installDate")) { + var error = $root.google.type.Date.verify(message.installDate); + if (error) + return "installDate." + error; + } + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + if (!$util.isString(message.helpLink)) + return "helpLink: string expected"; + return null; + }; + + /** + * Creates a WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + */ + WindowsApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsApplication) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsApplication(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.displayVersion != null) + message.displayVersion = String(object.displayVersion); + if (object.publisher != null) + message.publisher = String(object.publisher); + if (object.installDate != null) { + if (typeof object.installDate !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsApplication.installDate: object expected"); + message.installDate = $root.google.type.Date.fromObject(object.installDate); + } + if (object.helpLink != null) + message.helpLink = String(object.helpLink); + return message; + }; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsApplication} message WindowsApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.displayVersion = ""; + object.publisher = ""; + object.installDate = null; + object.helpLink = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + object.displayVersion = message.displayVersion; + if (message.publisher != null && message.hasOwnProperty("publisher")) + object.publisher = message.publisher; + if (message.installDate != null && message.hasOwnProperty("installDate")) + object.installDate = $root.google.type.Date.toObject(message.installDate, options); + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + object.helpLink = message.helpLink; + return object; + }; + + /** + * Converts this WindowsApplication to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + * @returns {Object.} JSON object + */ + WindowsApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WindowsApplication; + })(); + return Inventory; })(); @@ -48531,6 +48846,238 @@ return Expr; })(); + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(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]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.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.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.year = reader.int32(); + break; + case 2: + message.month = reader.int32(); + break; + case 3: + message.day = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Date; + })(); + return type; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 725e85c1faab..d0a6e9232d6a 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -3269,7 +3269,8 @@ "zypperPatch", "wuaPackage", "qfePackage", - "cosPackage" + "cosPackage", + "windowsApplication" ] } }, @@ -3305,6 +3306,10 @@ "cosPackage": { "type": "VersionedPackage", "id": 8 + }, + "windowsApplication": { + "type": "WindowsApplication", + "id": 9 } } }, @@ -3420,6 +3425,30 @@ "id": 5 } } + }, + "WindowsApplication": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "displayVersion": { + "type": "string", + "id": 2 + }, + "publisher": { + "type": "string", + "id": 3 + }, + "installDate": { + "type": "google.type.Date", + "id": 4 + }, + "helpLink": { + "type": "string", + "id": 5 + } + } } } } @@ -4771,11 +4800,12 @@ }, "type": { "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "go_package": "google.golang.org/genproto/googleapis/type/date;date", "java_multiple_files": true, - "java_outer_classname": "ExprProto", + "java_outer_classname": "DateProto", "java_package": "com.google.type", - "objc_class_prefix": "GTP" + "objc_class_prefix": "GTP", + "cc_enable_arenas": true }, "nested": { "Expr": { @@ -4797,6 +4827,22 @@ "id": 4 } } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } } } },