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 11c998acb01..8f89d8b89b9 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.osconfig.v1; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; import "google/type/date.proto"; @@ -30,8 +32,19 @@ option ruby_package = "Google::Cloud::OsConfig::V1"; // OS Config Inventory is a service for collecting and reporting operating // system and package information on VM instances. -// The inventory details of a VM. +// This API resource represents the available inventory data for a +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// You can use this API resource to determine the inventory data of your VM. +// +// For more information, see [Information provided by OS inventory +// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). message Inventory { + option (google.api.resource) = { + type: "osconfig.googleapis.com/Inventory" + pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory" + }; + // Operating system information for the VM. message OsInfo { // The VM hostname. @@ -154,7 +167,7 @@ message Inventory { // Details of a COS package. VersionedPackage cos_package = 8; - // Details of a Windows Application + // Details of Windows Application. WindowsApplication windows_application = 9; } } @@ -172,6 +185,21 @@ message Inventory { string version = 3; } + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + // Details related to a Windows Update package. // Field data and names are taken from Windows Update API IUpdate Interface: // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ @@ -218,21 +246,6 @@ message Inventory { google.protobuf.Timestamp last_deployment_change_time = 10; } - // Details related to a Zypper Patch. - message ZypperPatch { - // The name of the patch. - string patch_name = 5; - - // The category of the patch. - string category = 2; - - // The severity specified for this patch - string severity = 3; - - // Any summary information provided about this patch. - string summary = 4; - } - // Information related to a Quick Fix Engineering package. // Fields are taken from Windows QuickFixEngineering Interface and match // the source names: @@ -276,6 +289,12 @@ message Inventory { string help_link = 5; } + // Output only. The `Inventory` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Base level operating system information for the VM. OsInfo os_info = 1; @@ -284,4 +303,84 @@ message Inventory { // addressable inventory item and will change, when there is a new package // version. map items = 2; + + // Output only. Timestamp of the last reported inventory for the VM. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting inventory data for the specified VM. +message GetInventoryRequest { + // Required. API resource name for inventory resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/inventory` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/Inventory" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; +} + +// A request message for listing inventory data for all VMs in the specified +// location. +message ListInventoriesRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; + + // The maximum number of results to return. + int32 page_size = 3; + + // A pagination token returned from a previous call to + // `ListInventories` that indicates where this listing + // should continue from. + string page_token = 4; + + // If provided, this field specifies the criteria that must be met by a + // `Inventory` API resource to be included in the response. + string filter = 5; +} + +// A response message for listing inventory data for all VMs in a specified +// location. +message ListInventoriesResponse { + // List of inventory objects. + repeated Inventory inventories = 1; + + // The pagination token to retrieve the next page of inventory objects. + string next_page_token = 2; +} + +// The view for inventory objects. +enum InventoryView { + // The default value. + // The API defaults to the BASIC view. + INVENTORY_VIEW_UNSPECIFIED = 0; + + // Returns the basic inventory information that includes `os_info`. + BASIC = 1; + + // Returns all fields. + FULL = 2; } diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto index 2a654eaa2a4..88857b26b56 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -32,6 +32,7 @@ option ruby_package = "Google::Cloud::OsConfig::V1"; option (google.api.resource_definition) = { type: "compute.googleapis.com/Instance" pattern: "projects/{project}/zones/{zone}/instances/{instance}" + pattern: "projects/{project}/locations/{location}/instances/{instance}" }; // OS Config API diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto new file mode 100644 index 00000000000..22219f53973 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -0,0 +1,74 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.osconfig.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/cloud/osconfig/v1/vulnerability.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsConfigZonalServiceProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Zonal OS Config API +// +// The OS Config service is the server-side component that allows users to +// manage package installations and patch jobs for Compute Engine VM instances. +service OsConfigZonalService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Get inventory data for the specified VM instance. If the VM has no + // associated inventory, the message `NOT_FOUND` is returned. + rpc GetInventory(GetInventoryRequest) returns (Inventory) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/inventory}" + }; + option (google.api.method_signature) = "name"; + } + + // List inventory data for all VM instances in the specified zone. + rpc ListInventories(ListInventoriesRequest) returns (ListInventoriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the vulnerability report for the specified VM instance. Only VMs with + // inventory data have vulnerability reports associated with them. + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) returns (VulnerabilityReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + }; + option (google.api.method_signature) = "name"; + } + + // List vulnerability reports for all VM instances in the specified zone. + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) returns (ListVulnerabilityReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto new file mode 100644 index 00000000000..af86fbe098f --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto @@ -0,0 +1,336 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// This API resource represents the vulnerability report for a specified +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// For more information, see [Vulnerability +// reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). +message VulnerabilityReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }; + + // A vulnerability affecting the VM instance. + message Vulnerability { + // Contains metadata information for the vulnerability. This information is + // collected from the upstream feed of the operating system. + message Details { + // A reference for this vulnerability. + message Reference { + // The url of the reference. + string url = 1; + + // The source of the reference e.g. NVD. + string source = 2; + } + + // The CVE of the vulnerability. CVE cannot be + // empty and the combination of should be unique + // across vulnerabilities for a VM. + string cve = 1; + + // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of + // 0 - 10 where 0 indicates low severity and 10 indicates high severity. + float cvss_v2_score = 2; + + // The full description of the CVSSv3 for this vulnerability from NVD. + CVSSv3 cvss_v3 = 3; + + // Assigned severity/impact ranking from the distro. + string severity = 4; + + // The note or description describing the vulnerability from the distro. + string description = 5; + + // Corresponds to the references attached to the `VulnerabilityDetails`. + repeated Reference references = 6; + } + + // Contains metadata as per the upstream feed of the operating system and + // NVD. + Details details = 1; + + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some distros, + // this field may be empty. + repeated string installed_inventory_item_ids = 2; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + repeated string available_inventory_item_ids = 3; + + // The timestamp for when the vulnerability was first detected. + google.protobuf.Timestamp create_time = 4; + + // The timestamp for when the vulnerability was last modified. + google.protobuf.Timestamp update_time = 5; + } + + // Output only. The `vulnerabilityReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of vulnerabilities affecting the VM. + repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp for when the last vulnerability report was generated for the + // VM. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting the vulnerability report for the specified VM. +message GetVulnerabilityReportRequest { + // Required. API resource name for vulnerability resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + } + ]; +} + +// A request message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListVulnerabilityReports` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `vulnerabilityReport` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsResponse { + // List of vulnerabilityReport objects. + repeated VulnerabilityReport vulnerability_reports = 1; + + // The pagination token to retrieve the next page of vulnerabilityReports + // object. + string next_page_token = 2; +} + +// Common Vulnerability Scoring System version 3. +// For details, see https://www.first.org/cvss/specification-document +message CVSSv3 { + // This metric reflects the context by which vulnerability exploitation is + // possible. + enum AttackVector { + // Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The vulnerable component is bound to the network stack and the set of + // possible attackers extends beyond the other options listed below, up to + // and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1; + + // The vulnerable component is bound to the network stack, but the attack is + // limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2; + + // The vulnerable component is not bound to the network stack and the + // attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3; + + // The attack requires the attacker to physically touch or manipulate the + // vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4; + } + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + enum AttackComplexity { + // Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0; + + // Specialized access conditions or extenuating circumstances do not exist. + // An attacker can expect repeatable success when attacking the vulnerable + // component. + ATTACK_COMPLEXITY_LOW = 1; + + // A successful attack depends on conditions beyond the attacker's control. + // That is, a successful attack cannot be accomplished at will, but requires + // the attacker to invest in some measurable amount of effort in preparation + // or execution against the vulnerable component before a successful attack + // can be expected. + ATTACK_COMPLEXITY_HIGH = 2; + } + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + enum PrivilegesRequired { + // Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + + // The attacker is unauthorized prior to attack, and therefore does not + // require any access to settings or files of the vulnerable system to + // carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1; + + // The attacker requires privileges that provide basic user capabilities + // that could normally affect only settings and files owned by a user. + // Alternatively, an attacker with Low privileges has the ability to access + // only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2; + + // The attacker requires privileges that provide significant (e.g., + // administrative) control over the vulnerable component allowing access to + // component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3; + } + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + enum UserInteraction { + // Invalid value. + USER_INTERACTION_UNSPECIFIED = 0; + + // The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1; + + // Successful exploitation of this vulnerability requires a user to take + // some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2; + } + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + enum Scope { + // Invalid value. + SCOPE_UNSPECIFIED = 0; + + // An exploited vulnerability can only affect resources managed by the same + // security authority. + SCOPE_UNCHANGED = 1; + + // An exploited vulnerability can affect resources beyond the security scope + // managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2; + } + + // The Impact metrics capture the effects of a successfully exploited + // vulnerability on the component that suffers the worst outcome that is most + // directly and predictably associated with the attack. + enum Impact { + // Invalid value. + IMPACT_UNSPECIFIED = 0; + + // High impact. + IMPACT_HIGH = 1; + + // Low impact. + IMPACT_LOW = 2; + + // No impact. + IMPACT_NONE = 3; + } + + // The base score is a function of the base metric scores. + // https://www.first.org/cvss/specification-document#Base-Metrics + float base_score = 1; + + // The Exploitability sub-score equation is derived from the Base + // Exploitability metrics. + // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics + float exploitability_score = 2; + + // The Impact sub-score equation is derived from the Base Impact metrics. + float impact_score = 3; + + // This metric reflects the context by which vulnerability exploitation is + // possible. + AttackVector attack_vector = 5; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 6; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 7; + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + UserInteraction user_interaction = 8; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 9; + + // This metric measures the impact to the confidentiality of the information + // resources managed by a software component due to a successfully exploited + // vulnerability. + Impact confidentiality_impact = 10; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 11; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 12; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index fb0641b4475..f22c061eff1 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -13221,11 +13221,17 @@ export namespace google { /** Properties of an Inventory. */ interface IInventory { + /** Inventory name */ + name?: (string|null); + /** Inventory osInfo */ osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); /** Inventory items */ items?: ({ [k: string]: google.cloud.osconfig.v1.Inventory.IItem }|null); + + /** Inventory updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); } /** Represents an Inventory. */ @@ -13237,12 +13243,18 @@ export namespace google { */ constructor(properties?: google.cloud.osconfig.v1.IInventory); + /** Inventory name. */ + public name: string; + /** Inventory osInfo. */ public osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); /** Inventory items. */ public items: { [k: string]: google.cloud.osconfig.v1.Inventory.IItem }; + /** Inventory updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + /** * Creates a new Inventory instance using the specified properties. * @param [properties] Properties to set @@ -13836,6 +13848,114 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ZypperPatch. */ + interface IZypperPatch { + + /** ZypperPatch patchName */ + patchName?: (string|null); + + /** ZypperPatch category */ + category?: (string|null); + + /** ZypperPatch severity */ + severity?: (string|null); + + /** ZypperPatch summary */ + summary?: (string|null); + } + + /** Represents a ZypperPatch. */ + class ZypperPatch implements IZypperPatch { + + /** + * Constructs a new ZypperPatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch); + + /** ZypperPatch patchName. */ + public patchName: string; + + /** ZypperPatch category. */ + public category: string; + + /** ZypperPatch severity. */ + public severity: string; + + /** ZypperPatch summary. */ + public summary: string; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperPatch instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperPatch + * @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.ZypperPatch; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperPatch + * @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.ZypperPatch; + + /** + * Verifies a ZypperPatch 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 ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperPatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @param message ZypperPatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.ZypperPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperPatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a WindowsUpdatePackage. */ interface IWindowsUpdatePackage { @@ -14073,114 +14193,6 @@ export namespace google { } } - /** Properties of a ZypperPatch. */ - interface IZypperPatch { - - /** ZypperPatch patchName */ - patchName?: (string|null); - - /** ZypperPatch category */ - category?: (string|null); - - /** ZypperPatch severity */ - severity?: (string|null); - - /** ZypperPatch summary */ - summary?: (string|null); - } - - /** Represents a ZypperPatch. */ - class ZypperPatch implements IZypperPatch { - - /** - * Constructs a new ZypperPatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch); - - /** ZypperPatch patchName. */ - public patchName: string; - - /** ZypperPatch category. */ - public category: string; - - /** ZypperPatch severity. */ - public severity: string; - - /** ZypperPatch summary. */ - public summary: string; - - /** - * Creates a new ZypperPatch instance using the specified properties. - * @param [properties] Properties to set - * @returns ZypperPatch instance - */ - public static create(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch): google.cloud.osconfig.v1.Inventory.ZypperPatch; - - /** - * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. - * @param message ZypperPatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. - * @param message ZypperPatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ZypperPatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ZypperPatch - * @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.ZypperPatch; - - /** - * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ZypperPatch - * @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.ZypperPatch; - - /** - * Verifies a ZypperPatch 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 ZypperPatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ZypperPatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.ZypperPatch; - - /** - * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. - * @param message ZypperPatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.osconfig.v1.Inventory.ZypperPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ZypperPatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a WindowsQuickFixEngineeringPackage. */ interface IWindowsQuickFixEngineeringPackage { @@ -14403,6 +14415,319 @@ export namespace google { public toJSON(): { [k: string]: any }; } } + + /** Properties of a GetInventoryRequest. */ + interface IGetInventoryRequest { + + /** GetInventoryRequest name */ + name?: (string|null); + + /** GetInventoryRequest view */ + view?: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView|null); + } + + /** Represents a GetInventoryRequest. */ + class GetInventoryRequest implements IGetInventoryRequest { + + /** + * Constructs a new GetInventoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetInventoryRequest); + + /** GetInventoryRequest name. */ + public name: string; + + /** GetInventoryRequest view. */ + public view: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView); + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInventoryRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetInventoryRequest): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInventoryRequest + * @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.GetInventoryRequest; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInventoryRequest + * @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.GetInventoryRequest; + + /** + * Verifies a GetInventoryRequest 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 GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInventoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @param message GetInventoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInventoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInventoriesRequest. */ + interface IListInventoriesRequest { + + /** ListInventoriesRequest parent */ + parent?: (string|null); + + /** ListInventoriesRequest view */ + view?: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView|null); + + /** ListInventoriesRequest pageSize */ + pageSize?: (number|null); + + /** ListInventoriesRequest pageToken */ + pageToken?: (string|null); + + /** ListInventoriesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInventoriesRequest. */ + class ListInventoriesRequest implements IListInventoriesRequest { + + /** + * Constructs a new ListInventoriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListInventoriesRequest); + + /** ListInventoriesRequest parent. */ + public parent: string; + + /** ListInventoriesRequest view. */ + public view: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView); + + /** ListInventoriesRequest pageSize. */ + public pageSize: number; + + /** ListInventoriesRequest pageToken. */ + public pageToken: string; + + /** ListInventoriesRequest filter. */ + public filter: string; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListInventoriesRequest): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesRequest + * @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.ListInventoriesRequest; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesRequest + * @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.ListInventoriesRequest; + + /** + * Verifies a ListInventoriesRequest 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 ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @param message ListInventoriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInventoriesResponse. */ + interface IListInventoriesResponse { + + /** ListInventoriesResponse inventories */ + inventories?: (google.cloud.osconfig.v1.IInventory[]|null); + + /** ListInventoriesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInventoriesResponse. */ + class ListInventoriesResponse implements IListInventoriesResponse { + + /** + * Constructs a new ListInventoriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListInventoriesResponse); + + /** ListInventoriesResponse inventories. */ + public inventories: google.cloud.osconfig.v1.IInventory[]; + + /** ListInventoriesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListInventoriesResponse): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesResponse + * @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.ListInventoriesResponse; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesResponse + * @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.ListInventoriesResponse; + + /** + * Verifies a ListInventoriesResponse 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 ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @param message ListInventoriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** InventoryView enum. */ + enum InventoryView { + INVENTORY_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } } } } diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index f3f041fd8e0..ddcb086fea6 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -32380,8 +32380,10 @@ * Properties of an Inventory. * @memberof google.cloud.osconfig.v1 * @interface IInventory + * @property {string|null} [name] Inventory name * @property {google.cloud.osconfig.v1.Inventory.IOsInfo|null} [osInfo] Inventory osInfo * @property {Object.|null} [items] Inventory items + * @property {google.protobuf.ITimestamp|null} [updateTime] Inventory updateTime */ /** @@ -32400,6 +32402,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * Inventory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.name = ""; + /** * Inventory osInfo. * @member {google.cloud.osconfig.v1.Inventory.IOsInfo|null|undefined} osInfo @@ -32416,6 +32426,14 @@ */ Inventory.prototype.items = $util.emptyObject; + /** + * Inventory updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.updateTime = null; + /** * Creates a new Inventory instance using the specified properties. * @function create @@ -32447,6 +32465,10 @@ writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.osconfig.v1.Inventory.Item.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -32481,6 +32503,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: + message.name = reader.string(); + break; case 1: message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.decode(reader, reader.uint32()); break; @@ -32506,6 +32531,9 @@ } message.items[key] = value; break; + case 4: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -32541,6 +32569,9 @@ Inventory.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; if (message.osInfo != null && message.hasOwnProperty("osInfo")) { var error = $root.google.cloud.osconfig.v1.Inventory.OsInfo.verify(message.osInfo); if (error) @@ -32556,6 +32587,11 @@ return "items." + error; } } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } return null; }; @@ -32571,6 +32607,8 @@ if (object instanceof $root.google.cloud.osconfig.v1.Inventory) return object; var message = new $root.google.cloud.osconfig.v1.Inventory(); + if (object.name != null) + message.name = String(object.name); if (object.osInfo != null) { if (typeof object.osInfo !== "object") throw TypeError(".google.cloud.osconfig.v1.Inventory.osInfo: object expected"); @@ -32586,6 +32624,11 @@ message.items[keys[i]] = $root.google.cloud.osconfig.v1.Inventory.Item.fromObject(object.items[keys[i]]); } } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } return message; }; @@ -32604,8 +32647,11 @@ var object = {}; if (options.objects || options.defaults) object.items = {}; - if (options.defaults) + if (options.defaults) { object.osInfo = null; + object.name = ""; + object.updateTime = null; + } if (message.osInfo != null && message.hasOwnProperty("osInfo")) object.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.toObject(message.osInfo, options); var keys2; @@ -32614,6 +32660,10 @@ for (var j = 0; j < keys2.length; ++j) object.items[keys2[j]] = $root.google.cloud.osconfig.v1.Inventory.Item.toObject(message.items[keys2[j]], options); } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; @@ -34113,35 +34163,27 @@ return VersionedPackage; })(); - Inventory.WindowsUpdatePackage = (function() { + Inventory.ZypperPatch = (function() { /** - * Properties of a WindowsUpdatePackage. + * Properties of a ZypperPatch. * @memberof google.cloud.osconfig.v1.Inventory - * @interface IWindowsUpdatePackage - * @property {string|null} [title] WindowsUpdatePackage title - * @property {string|null} [description] WindowsUpdatePackage description - * @property {Array.|null} [categories] WindowsUpdatePackage categories - * @property {Array.|null} [kbArticleIds] WindowsUpdatePackage kbArticleIds - * @property {string|null} [supportUrl] WindowsUpdatePackage supportUrl - * @property {Array.|null} [moreInfoUrls] WindowsUpdatePackage moreInfoUrls - * @property {string|null} [updateId] WindowsUpdatePackage updateId - * @property {number|null} [revisionNumber] WindowsUpdatePackage revisionNumber - * @property {google.protobuf.ITimestamp|null} [lastDeploymentChangeTime] WindowsUpdatePackage lastDeploymentChangeTime + * @interface IZypperPatch + * @property {string|null} [patchName] ZypperPatch patchName + * @property {string|null} [category] ZypperPatch category + * @property {string|null} [severity] ZypperPatch severity + * @property {string|null} [summary] ZypperPatch summary */ /** - * Constructs a new WindowsUpdatePackage. + * Constructs a new ZypperPatch. * @memberof google.cloud.osconfig.v1.Inventory - * @classdesc Represents a WindowsUpdatePackage. - * @implements IWindowsUpdatePackage + * @classdesc Represents a ZypperPatch. + * @implements IZypperPatch * @constructor - * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set */ - function WindowsUpdatePackage(properties) { - this.categories = []; - this.kbArticleIds = []; - this.moreInfoUrls = []; + function ZypperPatch(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34149,188 +34191,114 @@ } /** - * WindowsUpdatePackage title. - * @member {string} title - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.title = ""; - - /** - * WindowsUpdatePackage description. - * @member {string} description - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.description = ""; - - /** - * WindowsUpdatePackage categories. - * @member {Array.} categories - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.categories = $util.emptyArray; - - /** - * WindowsUpdatePackage kbArticleIds. - * @member {Array.} kbArticleIds - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.kbArticleIds = $util.emptyArray; - - /** - * WindowsUpdatePackage supportUrl. - * @member {string} supportUrl - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.supportUrl = ""; - - /** - * WindowsUpdatePackage moreInfoUrls. - * @member {Array.} moreInfoUrls - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * ZypperPatch patchName. + * @member {string} patchName + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance */ - WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; + ZypperPatch.prototype.patchName = ""; /** - * WindowsUpdatePackage updateId. - * @member {string} updateId - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * ZypperPatch category. + * @member {string} category + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance */ - WindowsUpdatePackage.prototype.updateId = ""; + ZypperPatch.prototype.category = ""; /** - * WindowsUpdatePackage revisionNumber. - * @member {number} revisionNumber - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * ZypperPatch severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance */ - WindowsUpdatePackage.prototype.revisionNumber = 0; + ZypperPatch.prototype.severity = ""; /** - * WindowsUpdatePackage lastDeploymentChangeTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * ZypperPatch summary. + * @member {string} summary + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance */ - WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; + ZypperPatch.prototype.summary = ""; /** - * Creates a new WindowsUpdatePackage instance using the specified properties. + * Creates a new ZypperPatch instance using the specified properties. * @function create - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static - * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch instance */ - WindowsUpdatePackage.create = function create(properties) { - return new WindowsUpdatePackage(properties); + ZypperPatch.create = function create(properties) { + return new ZypperPatch(properties); }; /** - * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. * @function encode - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static - * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WindowsUpdatePackage.encode = function encode(message, writer) { + ZypperPatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.categories != null && message.categories.length) - for (var i = 0; i < message.categories.length; ++i) - $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.encode(message.categories[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.kbArticleIds != null && message.kbArticleIds.length) - for (var i = 0; i < message.kbArticleIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.kbArticleIds[i]); - if (message.moreInfoUrls != null && message.moreInfoUrls.length) - for (var i = 0; i < message.moreInfoUrls.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.moreInfoUrls[i]); - if (message.updateId != null && Object.hasOwnProperty.call(message, "updateId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.updateId); - if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.revisionNumber); - if (message.lastDeploymentChangeTime != null && Object.hasOwnProperty.call(message, "lastDeploymentChangeTime")) - $root.google.protobuf.Timestamp.encode(message.lastDeploymentChangeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.supportUrl != null && Object.hasOwnProperty.call(message, "supportUrl")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportUrl); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.category); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.severity); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); + if (message.patchName != null && Object.hasOwnProperty.call(message, "patchName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.patchName); return writer; }; /** - * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static - * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { + ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * Decodes a ZypperPatch message from the specified reader or buffer. * @function decode - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @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.WindowsUpdatePackage} WindowsUpdatePackage + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WindowsUpdatePackage.decode = function decode(reader, length) { + ZypperPatch.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.WindowsUpdatePackage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.title = reader.string(); + case 5: + message.patchName = reader.string(); break; case 2: - message.description = reader.string(); + message.category = reader.string(); break; case 3: - if (!(message.categories && message.categories.length)) - message.categories = []; - message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); + message.severity = reader.string(); break; case 4: - if (!(message.kbArticleIds && message.kbArticleIds.length)) - message.kbArticleIds = []; - message.kbArticleIds.push(reader.string()); - break; - case 11: - message.supportUrl = reader.string(); - break; - case 5: - if (!(message.moreInfoUrls && message.moreInfoUrls.length)) - message.moreInfoUrls = []; - message.moreInfoUrls.push(reader.string()); - break; - case 6: - message.updateId = reader.string(); - break; - case 7: - message.revisionNumber = reader.int32(); - break; - case 10: - message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.summary = reader.string(); break; default: reader.skipType(tag & 7); @@ -34341,548 +34309,332 @@ }; /** - * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WindowsUpdatePackage.decodeDelimited = function decodeDelimited(reader) { + ZypperPatch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WindowsUpdatePackage message. + * Verifies a ZypperPatch message. * @function verify - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WindowsUpdatePackage.verify = function verify(message) { + ZypperPatch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.categories != null && message.hasOwnProperty("categories")) { - if (!Array.isArray(message.categories)) - return "categories: array expected"; - for (var i = 0; i < message.categories.length; ++i) { - var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify(message.categories[i]); - if (error) - return "categories." + error; - } - } - if (message.kbArticleIds != null && message.hasOwnProperty("kbArticleIds")) { - if (!Array.isArray(message.kbArticleIds)) - return "kbArticleIds: array expected"; - for (var i = 0; i < message.kbArticleIds.length; ++i) - if (!$util.isString(message.kbArticleIds[i])) - return "kbArticleIds: string[] expected"; - } - if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) - if (!$util.isString(message.supportUrl)) - return "supportUrl: string expected"; - if (message.moreInfoUrls != null && message.hasOwnProperty("moreInfoUrls")) { - if (!Array.isArray(message.moreInfoUrls)) - return "moreInfoUrls: array expected"; - for (var i = 0; i < message.moreInfoUrls.length; ++i) - if (!$util.isString(message.moreInfoUrls[i])) - return "moreInfoUrls: string[] expected"; - } - if (message.updateId != null && message.hasOwnProperty("updateId")) - if (!$util.isString(message.updateId)) - return "updateId: string expected"; - if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) - if (!$util.isInteger(message.revisionNumber)) - return "revisionNumber: integer expected"; - if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastDeploymentChangeTime); - if (error) - return "lastDeploymentChangeTime." + error; - } + if (message.patchName != null && message.hasOwnProperty("patchName")) + if (!$util.isString(message.patchName)) + return "patchName: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + if (!$util.isString(message.severity)) + return "severity: string expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; return null; }; /** - * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static * @param {Object.} object Plain object - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch */ - WindowsUpdatePackage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + ZypperPatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.ZypperPatch) return object; - var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.categories) { - if (!Array.isArray(object.categories)) - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: array expected"); - message.categories = []; - for (var i = 0; i < object.categories.length; ++i) { - if (typeof object.categories[i] !== "object") - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: object expected"); - message.categories[i] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.fromObject(object.categories[i]); - } - } - if (object.kbArticleIds) { - if (!Array.isArray(object.kbArticleIds)) - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.kbArticleIds: array expected"); - message.kbArticleIds = []; - for (var i = 0; i < object.kbArticleIds.length; ++i) - message.kbArticleIds[i] = String(object.kbArticleIds[i]); - } - if (object.supportUrl != null) - message.supportUrl = String(object.supportUrl); - if (object.moreInfoUrls) { - if (!Array.isArray(object.moreInfoUrls)) - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.moreInfoUrls: array expected"); - message.moreInfoUrls = []; - for (var i = 0; i < object.moreInfoUrls.length; ++i) - message.moreInfoUrls[i] = String(object.moreInfoUrls[i]); - } - if (object.updateId != null) - message.updateId = String(object.updateId); - if (object.revisionNumber != null) - message.revisionNumber = object.revisionNumber | 0; - if (object.lastDeploymentChangeTime != null) { - if (typeof object.lastDeploymentChangeTime !== "object") - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.lastDeploymentChangeTime: object expected"); - message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.fromObject(object.lastDeploymentChangeTime); - } + var message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); + if (object.patchName != null) + message.patchName = String(object.patchName); + if (object.category != null) + message.category = String(object.category); + if (object.severity != null) + message.severity = String(object.severity); + if (object.summary != null) + message.summary = String(object.summary); return message; }; /** - * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage + * @param {google.cloud.osconfig.v1.Inventory.ZypperPatch} message ZypperPatch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WindowsUpdatePackage.toObject = function toObject(message, options) { + ZypperPatch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.categories = []; - object.kbArticleIds = []; - object.moreInfoUrls = []; - } if (options.defaults) { - object.title = ""; - object.description = ""; - object.updateId = ""; - object.revisionNumber = 0; - object.lastDeploymentChangeTime = null; - object.supportUrl = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.categories && message.categories.length) { - object.categories = []; - for (var j = 0; j < message.categories.length; ++j) - object.categories[j] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.toObject(message.categories[j], options); - } - if (message.kbArticleIds && message.kbArticleIds.length) { - object.kbArticleIds = []; - for (var j = 0; j < message.kbArticleIds.length; ++j) - object.kbArticleIds[j] = message.kbArticleIds[j]; - } - if (message.moreInfoUrls && message.moreInfoUrls.length) { - object.moreInfoUrls = []; - for (var j = 0; j < message.moreInfoUrls.length; ++j) - object.moreInfoUrls[j] = message.moreInfoUrls[j]; + object.category = ""; + object.severity = ""; + object.summary = ""; + object.patchName = ""; } - if (message.updateId != null && message.hasOwnProperty("updateId")) - object.updateId = message.updateId; - if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) - object.revisionNumber = message.revisionNumber; - if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) - object.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.toObject(message.lastDeploymentChangeTime, options); - if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) - object.supportUrl = message.supportUrl; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = message.severity; + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.patchName != null && message.hasOwnProperty("patchName")) + object.patchName = message.patchName; return object; }; /** - * Converts this WindowsUpdatePackage to JSON. + * Converts this ZypperPatch to JSON. * @function toJSON - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance * @returns {Object.} JSON object */ - WindowsUpdatePackage.prototype.toJSON = function toJSON() { + ZypperPatch.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - WindowsUpdatePackage.WindowsUpdateCategory = (function() { - - /** - * Properties of a WindowsUpdateCategory. - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @interface IWindowsUpdateCategory - * @property {string|null} [id] WindowsUpdateCategory id - * @property {string|null} [name] WindowsUpdateCategory name - */ + return ZypperPatch; + })(); - /** - * Constructs a new WindowsUpdateCategory. - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @classdesc Represents a WindowsUpdateCategory. - * @implements IWindowsUpdateCategory - * @constructor - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set - */ - function WindowsUpdateCategory(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]]; - } + Inventory.WindowsUpdatePackage = (function() { - /** - * WindowsUpdateCategory id. - * @member {string} id - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @instance - */ - WindowsUpdateCategory.prototype.id = ""; + /** + * Properties of a WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsUpdatePackage + * @property {string|null} [title] WindowsUpdatePackage title + * @property {string|null} [description] WindowsUpdatePackage description + * @property {Array.|null} [categories] WindowsUpdatePackage categories + * @property {Array.|null} [kbArticleIds] WindowsUpdatePackage kbArticleIds + * @property {string|null} [supportUrl] WindowsUpdatePackage supportUrl + * @property {Array.|null} [moreInfoUrls] WindowsUpdatePackage moreInfoUrls + * @property {string|null} [updateId] WindowsUpdatePackage updateId + * @property {number|null} [revisionNumber] WindowsUpdatePackage revisionNumber + * @property {google.protobuf.ITimestamp|null} [lastDeploymentChangeTime] WindowsUpdatePackage lastDeploymentChangeTime + */ - /** - * WindowsUpdateCategory name. - * @member {string} name - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @instance - */ - WindowsUpdateCategory.prototype.name = ""; + /** + * Constructs a new WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsUpdatePackage. + * @implements IWindowsUpdatePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + */ + function WindowsUpdatePackage(properties) { + this.categories = []; + this.kbArticleIds = []; + this.moreInfoUrls = []; + 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 WindowsUpdateCategory instance using the specified properties. - * @function create - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory instance - */ - WindowsUpdateCategory.create = function create(properties) { - return new WindowsUpdateCategory(properties); - }; - - /** - * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. - * @function encode - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WindowsUpdateCategory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - return writer; - }; - - /** - * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WindowsUpdateCategory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WindowsUpdateCategory message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @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.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WindowsUpdateCategory.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.WindowsUpdatePackage.WindowsUpdateCategory(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WindowsUpdateCategory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WindowsUpdateCategory message. - * @function verify - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WindowsUpdateCategory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory - */ - WindowsUpdateCategory.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - return object; - var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} message WindowsUpdateCategory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WindowsUpdateCategory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.name = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this WindowsUpdateCategory to JSON. - * @function toJSON - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @instance - * @returns {Object.} JSON object - */ - WindowsUpdateCategory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WindowsUpdateCategory; - })(); + /** + * WindowsUpdatePackage title. + * @member {string} title + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.title = ""; - return WindowsUpdatePackage; - })(); + /** + * WindowsUpdatePackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.description = ""; - Inventory.ZypperPatch = (function() { + /** + * WindowsUpdatePackage categories. + * @member {Array.} categories + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.categories = $util.emptyArray; /** - * Properties of a ZypperPatch. - * @memberof google.cloud.osconfig.v1.Inventory - * @interface IZypperPatch - * @property {string|null} [patchName] ZypperPatch patchName - * @property {string|null} [category] ZypperPatch category - * @property {string|null} [severity] ZypperPatch severity - * @property {string|null} [summary] ZypperPatch summary + * WindowsUpdatePackage kbArticleIds. + * @member {Array.} kbArticleIds + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance */ + WindowsUpdatePackage.prototype.kbArticleIds = $util.emptyArray; /** - * Constructs a new ZypperPatch. - * @memberof google.cloud.osconfig.v1.Inventory - * @classdesc Represents a ZypperPatch. - * @implements IZypperPatch - * @constructor - * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + * WindowsUpdatePackage supportUrl. + * @member {string} supportUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance */ - function ZypperPatch(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]]; - } + WindowsUpdatePackage.prototype.supportUrl = ""; /** - * ZypperPatch patchName. - * @member {string} patchName - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * WindowsUpdatePackage moreInfoUrls. + * @member {Array.} moreInfoUrls + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance */ - ZypperPatch.prototype.patchName = ""; + WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; /** - * ZypperPatch category. - * @member {string} category - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * WindowsUpdatePackage updateId. + * @member {string} updateId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance */ - ZypperPatch.prototype.category = ""; + WindowsUpdatePackage.prototype.updateId = ""; /** - * ZypperPatch severity. - * @member {string} severity - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * WindowsUpdatePackage revisionNumber. + * @member {number} revisionNumber + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance */ - ZypperPatch.prototype.severity = ""; + WindowsUpdatePackage.prototype.revisionNumber = 0; /** - * ZypperPatch summary. - * @member {string} summary - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * WindowsUpdatePackage lastDeploymentChangeTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance */ - ZypperPatch.prototype.summary = ""; + WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; /** - * Creates a new ZypperPatch instance using the specified properties. + * Creates a new WindowsUpdatePackage instance using the specified properties. * @function create - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static - * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set - * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch instance + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance */ - ZypperPatch.create = function create(properties) { - return new ZypperPatch(properties); + WindowsUpdatePackage.create = function create(properties) { + return new WindowsUpdatePackage(properties); }; /** - * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. * @function encode - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static - * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ZypperPatch.encode = function encode(message, writer) { + WindowsUpdatePackage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.category); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.severity); - if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); - if (message.patchName != null && Object.hasOwnProperty.call(message, "patchName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.patchName); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.encode(message.categories[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kbArticleIds != null && message.kbArticleIds.length) + for (var i = 0; i < message.kbArticleIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kbArticleIds[i]); + if (message.moreInfoUrls != null && message.moreInfoUrls.length) + for (var i = 0; i < message.moreInfoUrls.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.moreInfoUrls[i]); + if (message.updateId != null && Object.hasOwnProperty.call(message, "updateId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.updateId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.revisionNumber); + if (message.lastDeploymentChangeTime != null && Object.hasOwnProperty.call(message, "lastDeploymentChangeTime")) + $root.google.protobuf.Timestamp.encode(message.lastDeploymentChangeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.supportUrl != null && Object.hasOwnProperty.call(message, "supportUrl")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportUrl); return writer; }; /** - * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static - * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { + WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ZypperPatch message from the specified reader or buffer. + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. * @function decode - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @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.ZypperPatch} ZypperPatch + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ZypperPatch.decode = function decode(reader, length) { + WindowsUpdatePackage.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.ZypperPatch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.patchName = reader.string(); + case 1: + message.title = reader.string(); break; case 2: - message.category = reader.string(); + message.description = reader.string(); break; case 3: - message.severity = reader.string(); + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); break; case 4: - message.summary = reader.string(); + if (!(message.kbArticleIds && message.kbArticleIds.length)) + message.kbArticleIds = []; + message.kbArticleIds.push(reader.string()); + break; + case 11: + message.supportUrl = reader.string(); + break; + case 5: + if (!(message.moreInfoUrls && message.moreInfoUrls.length)) + message.moreInfoUrls = []; + message.moreInfoUrls.push(reader.string()); + break; + case 6: + message.updateId = reader.string(); + break; + case 7: + message.revisionNumber = reader.int32(); + break; + case 10: + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -34893,112 +34645,410 @@ }; /** - * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ZypperPatch.decodeDelimited = function decodeDelimited(reader) { + WindowsUpdatePackage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ZypperPatch message. + * Verifies a WindowsUpdatePackage message. * @function verify - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ZypperPatch.verify = function verify(message) { + WindowsUpdatePackage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.patchName != null && message.hasOwnProperty("patchName")) - if (!$util.isString(message.patchName)) - return "patchName: string expected"; - if (message.category != null && message.hasOwnProperty("category")) - if (!$util.isString(message.category)) - return "category: string expected"; - if (message.severity != null && message.hasOwnProperty("severity")) - if (!$util.isString(message.severity)) - return "severity: string expected"; - if (message.summary != null && message.hasOwnProperty("summary")) - if (!$util.isString(message.summary)) - return "summary: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + if (message.kbArticleIds != null && message.hasOwnProperty("kbArticleIds")) { + if (!Array.isArray(message.kbArticleIds)) + return "kbArticleIds: array expected"; + for (var i = 0; i < message.kbArticleIds.length; ++i) + if (!$util.isString(message.kbArticleIds[i])) + return "kbArticleIds: string[] expected"; + } + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + if (!$util.isString(message.supportUrl)) + return "supportUrl: string expected"; + if (message.moreInfoUrls != null && message.hasOwnProperty("moreInfoUrls")) { + if (!Array.isArray(message.moreInfoUrls)) + return "moreInfoUrls: array expected"; + for (var i = 0; i < message.moreInfoUrls.length; ++i) + if (!$util.isString(message.moreInfoUrls[i])) + return "moreInfoUrls: string[] expected"; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + if (!$util.isString(message.updateId)) + return "updateId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber)) + return "revisionNumber: integer expected"; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastDeploymentChangeTime); + if (error) + return "lastDeploymentChangeTime." + error; + } return null; }; /** - * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static * @param {Object.} object Plain object - * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage */ - ZypperPatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.osconfig.v1.Inventory.ZypperPatch) + WindowsUpdatePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) return object; - var message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); - if (object.patchName != null) - message.patchName = String(object.patchName); - if (object.category != null) - message.category = String(object.category); - if (object.severity != null) - message.severity = String(object.severity); - if (object.summary != null) - message.summary = String(object.summary); + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: object expected"); + message.categories[i] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.fromObject(object.categories[i]); + } + } + if (object.kbArticleIds) { + if (!Array.isArray(object.kbArticleIds)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.kbArticleIds: array expected"); + message.kbArticleIds = []; + for (var i = 0; i < object.kbArticleIds.length; ++i) + message.kbArticleIds[i] = String(object.kbArticleIds[i]); + } + if (object.supportUrl != null) + message.supportUrl = String(object.supportUrl); + if (object.moreInfoUrls) { + if (!Array.isArray(object.moreInfoUrls)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.moreInfoUrls: array expected"); + message.moreInfoUrls = []; + for (var i = 0; i < object.moreInfoUrls.length; ++i) + message.moreInfoUrls[i] = String(object.moreInfoUrls[i]); + } + if (object.updateId != null) + message.updateId = String(object.updateId); + if (object.revisionNumber != null) + message.revisionNumber = object.revisionNumber | 0; + if (object.lastDeploymentChangeTime != null) { + if (typeof object.lastDeploymentChangeTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.lastDeploymentChangeTime: object expected"); + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.fromObject(object.lastDeploymentChangeTime); + } return message; }; /** - * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static - * @param {google.cloud.osconfig.v1.Inventory.ZypperPatch} message ZypperPatch + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ZypperPatch.toObject = function toObject(message, options) { + WindowsUpdatePackage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.categories = []; + object.kbArticleIds = []; + object.moreInfoUrls = []; + } if (options.defaults) { - object.category = ""; - object.severity = ""; - object.summary = ""; - object.patchName = ""; + object.title = ""; + object.description = ""; + object.updateId = ""; + object.revisionNumber = 0; + object.lastDeploymentChangeTime = null; + object.supportUrl = ""; } - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = message.severity; - if (message.summary != null && message.hasOwnProperty("summary")) - object.summary = message.summary; - if (message.patchName != null && message.hasOwnProperty("patchName")) - object.patchName = message.patchName; - return object; - }; - - /** - * Converts this ZypperPatch to JSON. + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.toObject(message.categories[j], options); + } + if (message.kbArticleIds && message.kbArticleIds.length) { + object.kbArticleIds = []; + for (var j = 0; j < message.kbArticleIds.length; ++j) + object.kbArticleIds[j] = message.kbArticleIds[j]; + } + if (message.moreInfoUrls && message.moreInfoUrls.length) { + object.moreInfoUrls = []; + for (var j = 0; j < message.moreInfoUrls.length; ++j) + object.moreInfoUrls[j] = message.moreInfoUrls[j]; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + object.updateId = message.updateId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + object.revisionNumber = message.revisionNumber; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) + object.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.toObject(message.lastDeploymentChangeTime, options); + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + object.supportUrl = message.supportUrl; + return object; + }; + + /** + * Converts this WindowsUpdatePackage to JSON. * @function toJSON - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance * @returns {Object.} JSON object */ - ZypperPatch.prototype.toJSON = function toJSON() { + WindowsUpdatePackage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ZypperPatch; + WindowsUpdatePackage.WindowsUpdateCategory = (function() { + + /** + * Properties of a WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @interface IWindowsUpdateCategory + * @property {string|null} [id] WindowsUpdateCategory id + * @property {string|null} [name] WindowsUpdateCategory name + */ + + /** + * Constructs a new WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @classdesc Represents a WindowsUpdateCategory. + * @implements IWindowsUpdateCategory + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + */ + function WindowsUpdateCategory(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]]; + } + + /** + * WindowsUpdateCategory id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.id = ""; + + /** + * WindowsUpdateCategory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.name = ""; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory instance + */ + WindowsUpdateCategory.create = function create(properties) { + return new WindowsUpdateCategory(properties); + }; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @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.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.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.WindowsUpdatePackage.WindowsUpdateCategory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdateCategory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdateCategory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + */ + WindowsUpdateCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} message WindowsUpdateCategory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdateCategory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdateCategory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WindowsUpdateCategory; + })(); + + return WindowsUpdatePackage; })(); Inventory.WindowsQuickFixEngineeringPackage = (function() { @@ -35544,6 +35594,775 @@ return Inventory; })(); + v1.GetInventoryRequest = (function() { + + /** + * Properties of a GetInventoryRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetInventoryRequest + * @property {string|null} [name] GetInventoryRequest name + * @property {google.cloud.osconfig.v1.InventoryView|null} [view] GetInventoryRequest view + */ + + /** + * Constructs a new GetInventoryRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetInventoryRequest. + * @implements IGetInventoryRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetInventoryRequest=} [properties] Properties to set + */ + function GetInventoryRequest(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]]; + } + + /** + * GetInventoryRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.name = ""; + + /** + * GetInventoryRequest view. + * @member {google.cloud.osconfig.v1.InventoryView} view + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.view = 0; + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest instance + */ + GetInventoryRequest.create = function create(properties) { + return new GetInventoryRequest(properties); + }; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @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.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.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.GetInventoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInventoryRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInventoryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + */ + GetInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetInventoryRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetInventoryRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.GetInventoryRequest} message GetInventoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInventoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetInventoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + * @returns {Object.} JSON object + */ + GetInventoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInventoryRequest; + })(); + + v1.ListInventoriesRequest = (function() { + + /** + * Properties of a ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListInventoriesRequest + * @property {string|null} [parent] ListInventoriesRequest parent + * @property {google.cloud.osconfig.v1.InventoryView|null} [view] ListInventoriesRequest view + * @property {number|null} [pageSize] ListInventoriesRequest pageSize + * @property {string|null} [pageToken] ListInventoriesRequest pageToken + * @property {string|null} [filter] ListInventoriesRequest filter + */ + + /** + * Constructs a new ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListInventoriesRequest. + * @implements IListInventoriesRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListInventoriesRequest=} [properties] Properties to set + */ + function ListInventoriesRequest(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]]; + } + + /** + * ListInventoriesRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.parent = ""; + + /** + * ListInventoriesRequest view. + * @member {google.cloud.osconfig.v1.InventoryView} view + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.view = 0; + + /** + * ListInventoriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageSize = 0; + + /** + * ListInventoriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageToken = ""; + + /** + * ListInventoriesRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.filter = ""; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest instance + */ + ListInventoriesRequest.create = function create(properties) { + return new ListInventoriesRequest(properties); + }; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @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.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.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.ListInventoriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.view = reader.int32(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + */ + ListInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListInventoriesRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListInventoriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.ListInventoriesRequest} message ListInventoriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInventoriesRequest; + })(); + + v1.ListInventoriesResponse = (function() { + + /** + * Properties of a ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListInventoriesResponse + * @property {Array.|null} [inventories] ListInventoriesResponse inventories + * @property {string|null} [nextPageToken] ListInventoriesResponse nextPageToken + */ + + /** + * Constructs a new ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListInventoriesResponse. + * @implements IListInventoriesResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListInventoriesResponse=} [properties] Properties to set + */ + function ListInventoriesResponse(properties) { + this.inventories = []; + 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]]; + } + + /** + * ListInventoriesResponse inventories. + * @member {Array.} inventories + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.inventories = $util.emptyArray; + + /** + * ListInventoriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse instance + */ + ListInventoriesResponse.create = function create(properties) { + return new ListInventoriesResponse(properties); + }; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inventories != null && message.inventories.length) + for (var i = 0; i < message.inventories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.encode(message.inventories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @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.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.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.ListInventoriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.inventories && message.inventories.length)) + message.inventories = []; + message.inventories.push($root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inventories != null && message.hasOwnProperty("inventories")) { + if (!Array.isArray(message.inventories)) + return "inventories: array expected"; + for (var i = 0; i < message.inventories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.verify(message.inventories[i]); + if (error) + return "inventories." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + */ + ListInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListInventoriesResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListInventoriesResponse(); + if (object.inventories) { + if (!Array.isArray(object.inventories)) + throw TypeError(".google.cloud.osconfig.v1.ListInventoriesResponse.inventories: array expected"); + message.inventories = []; + for (var i = 0; i < object.inventories.length; ++i) { + if (typeof object.inventories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListInventoriesResponse.inventories: object expected"); + message.inventories[i] = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.inventories[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.ListInventoriesResponse} message ListInventoriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inventories = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.inventories && message.inventories.length) { + object.inventories = []; + for (var j = 0; j < message.inventories.length; ++j) + object.inventories[j] = $root.google.cloud.osconfig.v1.Inventory.toObject(message.inventories[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInventoriesResponse; + })(); + + /** + * InventoryView enum. + * @name google.cloud.osconfig.v1.InventoryView + * @enum {number} + * @property {number} INVENTORY_VIEW_UNSPECIFIED=0 INVENTORY_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.InventoryView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVENTORY_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + return v1; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 53bc37b149e..80deb782604 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -3181,7 +3181,18 @@ }, "nested": { "Inventory": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/Inventory", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/inventory" + }, "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "osInfo": { "type": "OsInfo", "id": 1 @@ -3190,6 +3201,13 @@ "keyType": "string", "type": "Item", "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -3355,6 +3373,26 @@ } } }, + "ZypperPatch": { + "fields": { + "patchName": { + "type": "string", + "id": 5 + }, + "category": { + "type": "string", + "id": 2 + }, + "severity": { + "type": "string", + "id": 3 + }, + "summary": { + "type": "string", + "id": 4 + } + } + }, "WindowsUpdatePackage": { "fields": { "title": { @@ -3412,26 +3450,6 @@ } } }, - "ZypperPatch": { - "fields": { - "patchName": { - "type": "string", - "id": 5 - }, - "category": { - "type": "string", - "id": 2 - }, - "severity": { - "type": "string", - "id": 3 - }, - "summary": { - "type": "string", - "id": 4 - } - } - }, "WindowsQuickFixEngineeringPackage": { "fields": { "caption": { @@ -3477,6 +3495,70 @@ } } } + }, + "GetInventoryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/Inventory" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + } + } + }, + "ListInventoriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Instance" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListInventoriesResponse": { + "fields": { + "inventories": { + "rule": "repeated", + "type": "Inventory", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "InventoryView": { + "values": { + "INVENTORY_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } } } } diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 8c115bb4b07..a27708e9e7d 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -175,6 +175,9 @@ export class AssetServiceClient { folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), + inventoryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/inventory' + ), organizationFeedPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/feeds/{feed}' ), @@ -2988,6 +2991,58 @@ export class AssetServiceClient { return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).feed; } + /** + * Return a fully-qualified inventory resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + inventoryPath(project: string, location: string, instance: string) { + return this.pathTemplates.inventoryPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .project; + } + + /** + * Parse the location from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .location; + } + + /** + * Parse the instance from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .instance; + } + /** * Return a fully-qualified organizationFeed resource name string. * diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 8f0f62a9364..d3bcf99e463 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -2550,6 +2550,70 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('inventory', () => { + const fakePath = '/rendered/path/inventory'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.inventoryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.inventoryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('inventoryPath', () => { + const result = client.inventoryPath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.inventoryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInventoryName', () => { + const result = client.matchProjectFromInventoryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInventoryName', () => { + const result = client.matchLocationFromInventoryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInventoryName', () => { + const result = client.matchInstanceFromInventoryName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationFeed', () => { const fakePath = '/rendered/path/organizationFeed'; const expectedParameters = {