diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index c5873958ad4..ee8c4129d16 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -1046,4 +1046,7 @@ enum ContentType { // The Cloud Access context manager Policy set on an asset. ACCESS_POLICY = 5; + + // The runtime OS Inventory information. + OS_INVENTORY = 6; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index c06caf71a7d..f7e2432fcc7 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -21,6 +21,7 @@ import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/iam/v1/policy.proto"; import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; @@ -153,6 +154,11 @@ message Asset { google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; } + // A representation of runtime OS Inventory information. See [this + // topic](https://cloud.google.com/compute/docs/instances/os-inventory-management) + // for more information. + google.cloud.osconfig.v1.Inventory os_inventory = 12; + // The ancestry path of an asset in Google Cloud [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // represented as a list of relative resource names. An ancestry path starts 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 new file mode 100644 index 00000000000..ba3318e70e4 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto @@ -0,0 +1,258 @@ +// Copyright 2020 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/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 = "Inventories"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +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. +message Inventory { + // Operating system information for the VM. + message OsInfo { + // The VM hostname. + string hostname = 9; + + // The operating system long name. + // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019 + // Datacenter'. + string long_name = 2; + + // The operating system short name. + // For example, 'windows' or 'debian'. + string short_name = 3; + + // The version of the operating system. + string version = 4; + + // The system architecture of the operating system. + string architecture = 5; + + // The kernel version of the operating system. + string kernel_version = 6; + + // The kernel release of the operating system. + string kernel_release = 7; + + // The current version of the OS Config agent running on the VM. + string osconfig_agent_version = 8; + } + + // A single piece of inventory on a VM. + message Item { + // The origin of a specific inventory item. + enum OriginType { + // Invalid. An origin type must be specified. + ORIGIN_TYPE_UNSPECIFIED = 0; + + // This inventory item was discovered as the result of the agent + // reporting inventory via the reporting API. + INVENTORY_REPORT = 1; + } + + // The different types of inventory that are tracked on a VM. + enum Type { + // Invalid. An type must be specified. + TYPE_UNSPECIFIED = 0; + + // This represents a package that is installed on the VM. + INSTALLED_PACKAGE = 1; + + // This represents an update that is available for a package. + AVAILABLE_PACKAGE = 2; + } + + // Identifier for this item, unique across items for this VM. + string id = 1; + + // The origin of this inventory item. + OriginType origin_type = 2; + + // When this inventory item was first detected. + google.protobuf.Timestamp create_time = 8; + + // When this inventory item was last modified. + google.protobuf.Timestamp update_time = 9; + + // The specific type of inventory, correlating to its specific details. + Type type = 5; + + // Specific details of this inventory item based on its type. + oneof details { + // Software package present on the VM instance. + SoftwarePackage installed_package = 6; + + // Software package available to be installed on the VM instance. + SoftwarePackage available_package = 7; + } + } + + // Software package information of the operating system. + message SoftwarePackage { + // Information about the different types of software packages. + oneof details { + // Yum package info. + // For details about the yum package manager, see + // https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum. + VersionedPackage yum_package = 1; + + // Details of an APT package. + // For details about the apt package manager, see + // https://wiki.debian.org/Apt. + VersionedPackage apt_package = 2; + + // Details of a Zypper package. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + VersionedPackage zypper_package = 3; + + // Details of a Googet package. + // For details about the googet package manager, see + // https://github.com/google/googet. + VersionedPackage googet_package = 4; + + // Details of a Zypper patch. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + ZypperPatch zypper_patch = 5; + + // Details of a Windows Update package. + // See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for + // information about Windows Update. + WindowsUpdatePackage wua_package = 6; + + // Details of a Windows Quick Fix engineering package. + // See + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + // for info in Windows Quick Fix Engineering. + WindowsQuickFixEngineeringPackage qfe_package = 7; + + // Details of a COS package. + VersionedPackage cos_package = 8; + } + } + + // Information related to the a standard versioned package. This includes + // package info for APT, Yum, Zypper, and Googet package managers. + message VersionedPackage { + // The name of the package. + string package_name = 4; + + // The system architecture this package is intended for. + string architecture = 2; + + // The version of the package. + string version = 3; + } + + // 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/ + // Descriptive fields like title, and description are localized based on + // the locale of the VM being updated. + message WindowsUpdatePackage { + // Categories specified by the Windows Update. + message WindowsUpdateCategory { + // The identifier of the windows update category. + string id = 1; + + // The name of the windows update category. + string name = 2; + } + + // The localized title of the update package. + string title = 1; + + // The localized description of the update package. + string description = 2; + + // The categories that are associated with this update package. + repeated WindowsUpdateCategory categories = 3; + + // A collection of Microsoft Knowledge Base article IDs that are associated + // with the update package. + repeated string kb_article_ids = 4; + + // A hyperlink to the language-specific support information for the update. + string support_url = 11; + + // A collection of URLs that provide more information about the update + // package. + repeated string more_info_urls = 5; + + // Gets the identifier of an update package. Stays the same across + // revisions. + string update_id = 6; + + // The revision number of this update package. + int32 revision_number = 7; + + // The last published date of the update, in (UTC) date and time. + 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: + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + message WindowsQuickFixEngineeringPackage { + // A short textual description of the QFE update. + string caption = 1; + + // A textual description of the QFE update. + string description = 2; + + // Unique identifier associated with a particular QFE update. + string hot_fix_id = 3; + + // Date that the QFE update was installed. Mapped from installed_on field. + google.protobuf.Timestamp install_time = 5; + } + + // Base level operating system information for the VM. + OsInfo os_info = 1; + + // Inventory items related to the VM keyed by an opaque unique identifier for + // each inventory item. The identifier is unique to each distinct and + // addressable inventory item and will change, when there is a new package + // version. + map items = 2; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto new file mode 100644 index 00000000000..43059e9a62e --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto @@ -0,0 +1,38 @@ +// Copyright 2020 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; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "Common"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Message encapsulating a value that can be either absolute ("fixed") or +// relative ("percent") to a value. +message FixedOrPercent { + // Type of the value. + oneof mode { + // Specifies a fixed value. + int32 fixed = 1; + + // Specifies the relative value defined as a percentage, which will be + // multiplied by a reference value. + int32 percent = 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 new file mode 100644 index 00000000000..2a654eaa2a4 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -0,0 +1,119 @@ +// Copyright 2020 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/patch_deployments.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "OsConfigProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/zones/{zone}/instances/{instance}" +}; + +// OS Config API +// +// The OS Config service is a server-side component that you can use to +// manage package installations and patch jobs for virtual machine instances. +service OsConfigService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Patch VM instances by creating and running a patch job. + rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchJobs:execute" + body: "*" + }; + } + + // Get the patch job. This can be used to track the progress of an + // ongoing patch job or review the details of completed jobs. + rpc GetPatchJob(GetPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancel a patch job. The patch job must be active. Canceled patch jobs + // cannot be restarted. + rpc CancelPatchJob(CancelPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchJobs/*}:cancel" + body: "*" + }; + } + + // Get a list of patch jobs. + rpc ListPatchJobs(ListPatchJobsRequest) returns (ListPatchJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Get a list of instance details for a given patch job. + rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) returns (ListPatchJobInstanceDetailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/patchJobs/*}/instanceDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // Create an OS Config patch deployment. + rpc CreatePatchDeployment(CreatePatchDeploymentRequest) returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchDeployments" + body: "patch_deployment" + }; + option (google.api.method_signature) = "parent,patch_deployment,patch_deployment_id"; + } + + // Get an OS Config patch deployment. + rpc GetPatchDeployment(GetPatchDeploymentRequest) returns (PatchDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get a page of OS Config patch deployments. + rpc ListPatchDeployments(ListPatchDeploymentsRequest) returns (ListPatchDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete an OS Config patch deployment. + rpc DeletePatchDeployment(DeletePatchDeploymentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto new file mode 100644 index 00000000000..d8bb84a91e5 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -0,0 +1,274 @@ +// Copyright 2020 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/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/datetime.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "PatchDeployments"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Patch deployments are configurations that individual patch jobs use to +// complete a patch. These configurations include instance filter, package +// repository settings, and a schedule. For more information about creating and +// managing patch deployments, see [Scheduling patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/schedule-patch-jobs). +message PatchDeployment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchDeployment" + pattern: "projects/{project}/patchDeployments/{patch_deployment}" + }; + + // Unique name for the patch deployment resource in a project. The patch + // deployment name is in the form: + // `projects/{project_id}/patchDeployments/{patch_deployment_id}`. + // This field is ignored when you create a new patch deployment. + string name = 1; + + // Optional. Description of the patch deployment. Length of the description is + // limited to 1024 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. VM instances to patch. + PatchInstanceFilter instance_filter = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Patch configuration that is applied. + PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Duration of the patch. After the duration ends, the patch times + // out. + google.protobuf.Duration duration = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Schedule for the patch. + oneof schedule { + // Required. Schedule a one-time execution. + OneTimeSchedule one_time_schedule = 6 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule recurring executions. + RecurringSchedule recurring_schedule = 7 + [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. Time the patch deployment was created. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time the patch deployment was last updated. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time a patch job was started by this deployment. + // Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text + // format. + google.protobuf.Timestamp last_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Rollout strategy of the patch job. + PatchRollout rollout = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Sets the time for a one time patch deployment. Timestamp is in +// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. +message OneTimeSchedule { + // Required. The desired patch job execution time. + google.protobuf.Timestamp execute_time = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Sets the time for recurring patch deployments. +message RecurringSchedule { + // Specifies the frequency of the recurring patch deployments. + enum Frequency { + // Invalid. A frequency must be specified. + FREQUENCY_UNSPECIFIED = 0; + + // Indicates that the frequency should be expressed in terms of + // weeks. + WEEKLY = 1; + + // Indicates that the frequency should be expressed in terms of + // months. + MONTHLY = 2; + } + + // Required. Defines the time zone that `time_of_day` is relative to. + // The rules for daylight saving time are determined by the chosen time zone. + google.type.TimeZone time_zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The time that the recurring schedule becomes effective. + // Defaults to `create_time` of the patch deployment. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end time at which a recurring patch deployment schedule is no + // longer active. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Time of the day to run a recurring deployment. + google.type.TimeOfDay time_of_day = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The frequency unit of this recurring schedule. + Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for this recurring schedule. + // Configurations must match frequency. + oneof schedule_config { + // Required. Schedule with weekly executions. + WeeklySchedule weekly = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule with monthly executions. + MonthlySchedule monthly = 7 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The time the last patch job ran successfully. + google.protobuf.Timestamp last_execute_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the next patch job is scheduled to run. + google.protobuf.Timestamp next_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a weekly schedule. +message WeeklySchedule { + // Required. Day of the week. + google.type.DayOfWeek day_of_week = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a monthly schedule. An example of a valid monthly schedule is +// "on the third Tuesday of the month" or "on the 15th of the month". +message MonthlySchedule { + // One day in a month. + oneof day_of_month { + // Required. Week day in a month. + WeekDayOfMonth week_day_of_month = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. One day of the month. 1-31 indicates the 1st to the 31st day. + // -1 indicates the last day of the month. Months without the target day + // will be skipped. For example, a schedule to run "every month on the 31st" + // will not run in February, April, June, etc. + int32 month_day = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Represents one week day in a month. An example is "the 4th Sunday". +message WeekDayOfMonth { + // Required. Week number in a month. 1-4 indicates the 1st to 4th week of the + // month. -1 indicates the last week of the month. + int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for creating a patch deployment. +message CreatePatchDeploymentRequest { + // Required. The project to apply this patch deployment to in the form + // `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. A name for the patch deployment in the project. When creating a + // name the following rules apply: + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string patch_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The patch deployment to create. + PatchDeployment patch_deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for retrieving a patch deployment. +message GetPatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for listing patch deployments. +message ListPatchDeploymentsRequest { + // Required. The resource name of the parent in the form `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of patch deployments to return. Default is + // 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to + // ListPatchDeployments that indicates where this listing should continue + // from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for listing patch deployments. +message ListPatchDeploymentsResponse { + // The list of patch deployments. + repeated PatchDeployment patch_deployments = 1; + + // A pagination token that can be used to get the next page of patch + // deployments. + string next_page_token = 2; +} + +// A request message for deleting a patch deployment. +message DeletePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto new file mode 100644 index 00000000000..1fffb532a11 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto @@ -0,0 +1,739 @@ +// Copyright 2020 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/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.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_outer_classname = "PatchJobs"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// A request message to initiate patching across Compute Engine +// instances. +message ExecutePatchJobRequest { + // Required. The project in which to run this patch in the form `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Required. Instances to patch, either explicitly or filtered by some + // criteria such as zone or labels. + PatchInstanceFilter instance_filter = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Patch configuration being applied. If omitted, instances are + // patched using the default configurations. + PatchConfig patch_config = 4; + + // Duration of the patch job. After the duration ends, the patch job + // times out. + google.protobuf.Duration duration = 5; + + // If this patch is a dry-run only, instances are contacted but + // will do nothing. + bool dry_run = 6; + + // Display name for this patch job. This does not have to be unique. + string display_name = 8; + + // Rollout strategy of the patch job. + PatchRollout rollout = 9; +} + +// Request to get an active or completed patch job. +message GetPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Request to list details for all instances that are part of a patch job. +message ListPatchJobInstanceDetailsRequest { + // Required. The parent for the instances are in the form of + // `projects/*/patchJobs/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; + + // The maximum number of instance details records to return. Default is 100. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // A filter expression that filters results listed in the response. This + // field supports filtering results by instance zone, name, state, or + // `failure_reason`. + string filter = 4; +} + +// A response message for listing the instances details for a patch job. +message ListPatchJobInstanceDetailsResponse { + // A list of instance status. + repeated PatchJobInstanceDetails patch_job_instance_details = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// Patch details for a VM instance. For more information about reviewing VM +// instance details, see +// [Listing all VM instance details for a specific patch +// job](https://cloud.google.com/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details). +message PatchJobInstanceDetails { + // The instance name in the form `projects/*/zones/*/instances/*` + string name = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + }]; + + // The unique identifier for the instance. This identifier is + // defined by the server. + string instance_system_id = 2; + + // Current state of instance patch. + Instance.PatchState state = 3; + + // If the patch fails, this field provides the reason. + string failure_reason = 4; + + // The number of times the agent that the agent attempts to apply the patch. + int64 attempt_count = 5; +} + +// A request message for listing patch jobs. +message ListPatchJobsRequest { + // Required. In the form of `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The maximum number of instance status to return. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by patch + // jobs to be included in the response. + // Currently, filtering is only available on the patch_deployment field. + string filter = 4; +} + +// A response message for listing patch jobs. +message ListPatchJobsResponse { + // The list of patch jobs. + repeated PatchJob patch_jobs = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// A high level representation of a patch job that is either in progress +// or has completed. +// +// Instance details are not included in the job. To paginate through instance +// details, use ListPatchJobInstanceDetails. +// +// For more information about patch jobs, see +// [Creating patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/create-patch-job). +message PatchJob { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchJob" + pattern: "projects/{project}/patchJobs/{patch_job}" + }; + + // A summary of the current patch state across all instances that this patch + // job affects. Contains counts of instances in different states. These states + // map to `InstancePatchState`. List patch job instance details to see the + // specific states of each instance. + message InstanceDetailsSummary { + // Number of instances pending patch job. + int64 pending_instance_count = 1; + + // Number of instances that are inactive. + int64 inactive_instance_count = 2; + + // Number of instances notified about patch job. + int64 notified_instance_count = 3; + + // Number of instances that have started. + int64 started_instance_count = 4; + + // Number of instances that are downloading patches. + int64 downloading_patches_instance_count = 5; + + // Number of instances that are applying patches. + int64 applying_patches_instance_count = 6; + + // Number of instances rebooting. + int64 rebooting_instance_count = 7; + + // Number of instances that have completed successfully. + int64 succeeded_instance_count = 8; + + // Number of instances that require reboot. + int64 succeeded_reboot_required_instance_count = 9; + + // Number of instances that failed. + int64 failed_instance_count = 10; + + // Number of instances that have acked and will start shortly. + int64 acked_instance_count = 11; + + // Number of instances that exceeded the time out while applying the patch. + int64 timed_out_instance_count = 12; + + // Number of instances that are running the pre-patch step. + int64 pre_patch_step_instance_count = 13; + + // Number of instances that are running the post-patch step. + int64 post_patch_step_instance_count = 14; + + // Number of instances that do not appear to be running the agent. Check to + // ensure that the agent is installed, running, and able to communicate with + // the service. + int64 no_agent_detected_instance_count = 15; + } + + // Enumeration of the various states a patch job passes through as it + // executes. + enum State { + // State must be specified. + STATE_UNSPECIFIED = 0; + + // The patch job was successfully initiated. + STARTED = 1; + + // The patch job is looking up instances to run the patch on. + INSTANCE_LOOKUP = 2; + + // Instances are being patched. + PATCHING = 3; + + // Patch job completed successfully. + SUCCEEDED = 4; + + // Patch job completed but there were errors. + COMPLETED_WITH_ERRORS = 5; + + // The patch job was canceled. + CANCELED = 6; + + // The patch job timed out. + TIMED_OUT = 7; + } + + // Unique identifier for this patch job in the form + // `projects/*/patchJobs/*` + string name = 1; + + // Display name for this patch job. This is not a unique identifier. + string display_name = 14; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Time this patch job was created. + google.protobuf.Timestamp create_time = 3; + + // Last time this patch job was updated. + google.protobuf.Timestamp update_time = 4; + + // The current state of the PatchJob. + State state = 5; + + // Instances to patch. + PatchInstanceFilter instance_filter = 13; + + // Patch configuration being applied. + PatchConfig patch_config = 7; + + // Duration of the patch job. After the duration ends, the + // patch job times out. + google.protobuf.Duration duration = 8; + + // Summary of instance details. + InstanceDetailsSummary instance_details_summary = 9; + + // If this patch job is a dry run, the agent reports that it has + // finished without running any updates on the VM instance. + bool dry_run = 10; + + // If this patch job failed, this message provides information about the + // failure. + string error_message = 11; + + // Reflects the overall progress of the patch job in the range of + // 0.0 being no progress to 100.0 being complete. + double percent_complete = 12; + + // Output only. Name of the patch deployment that created this patch job. + string patch_deployment = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; + + // Rollout strategy being applied. + PatchRollout rollout = 16; +} + +// Patch configuration specifications. Contains details on how to apply the +// patch(es) to a VM instance. +message PatchConfig { + // Post-patch reboot settings. + enum RebootConfig { + // The default behavior is DEFAULT. + REBOOT_CONFIG_UNSPECIFIED = 0; + + // The agent decides if a reboot is necessary by checking signals such as + // registry keys on Windows or `/var/run/reboot-required` on APT based + // systems. On RPM based systems, a set of core system package install times + // are compared with system boot time. + DEFAULT = 1; + + // Always reboot the machine after the update completes. + ALWAYS = 2; + + // Never reboot the machine after the update completes. + NEVER = 3; + } + + // Post-patch reboot settings. + RebootConfig reboot_config = 1; + + // Apt update settings. Use this setting to override the default `apt` patch + // rules. + AptSettings apt = 3; + + // Yum update settings. Use this setting to override the default `yum` patch + // rules. + YumSettings yum = 4; + + // Goo update settings. Use this setting to override the default `goo` patch + // rules. + GooSettings goo = 5; + + // Zypper update settings. Use this setting to override the default `zypper` + // patch rules. + ZypperSettings zypper = 6; + + // Windows update settings. Use this override the default windows patch rules. + WindowsUpdateSettings windows_update = 7; + + // The `ExecStep` to run before the patch update. + ExecStep pre_step = 8; + + // The `ExecStep` to run after the patch update. + ExecStep post_step = 9; +} + +// Namespace for instance state enums. +message Instance { + // Patch state of an instance. + enum PatchState { + // Unspecified. + PATCH_STATE_UNSPECIFIED = 0; + + // The instance is not yet notified. + PENDING = 1; + + // Instance is inactive and cannot be patched. + INACTIVE = 2; + + // The instance is notified that it should be patched. + NOTIFIED = 3; + + // The instance has started the patching process. + STARTED = 4; + + // The instance is downloading patches. + DOWNLOADING_PATCHES = 5; + + // The instance is applying patches. + APPLYING_PATCHES = 6; + + // The instance is rebooting. + REBOOTING = 7; + + // The instance has completed applying patches. + SUCCEEDED = 8; + + // The instance has completed applying patches but a reboot is required. + SUCCEEDED_REBOOT_REQUIRED = 9; + + // The instance has failed to apply the patch. + FAILED = 10; + + // The instance acked the notification and will start shortly. + ACKED = 11; + + // The instance exceeded the time out while applying the patch. + TIMED_OUT = 12; + + // The instance is running the pre-patch step. + RUNNING_PRE_PATCH_STEP = 13; + + // The instance is running the post-patch step. + RUNNING_POST_PATCH_STEP = 14; + + // The service could not detect the presence of the agent. Check to ensure + // that the agent is installed, running, and able to communicate with the + // service. + NO_AGENT_DETECTED = 15; + } +} + +// Message for canceling a patch job. +message CancelPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Apt patching is completed by executing `apt-get update && apt-get +// upgrade`. Additional options can be set to control how this is executed. +message AptSettings { + // Apt patch type. + enum Type { + // By default, upgrade will be performed. + TYPE_UNSPECIFIED = 0; + + // Runs `apt-get dist-upgrade`. + DIST = 1; + + // Runs `apt-get upgrade`. + UPGRADE = 2; + } + + // By changing the type to DIST, the patching is performed + // using `apt-get dist-upgrade` instead. + Type type = 1; + + // List of packages to exclude from update. These packages will be excluded + repeated string excludes = 2; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field cannot be specified with any other patch configuration + // fields. + repeated string exclusive_packages = 3; +} + +// Yum patching is performed by executing `yum update`. Additional options +// can be set to control how this is executed. +// +// Note that not all settings are supported on all platforms. +message YumSettings { + // Adds the `--security` flag to `yum update`. Not supported on + // all platforms. + bool security = 1; + + // Will cause patch to run `yum update-minimal` instead. + bool minimal = 2; + + // List of packages to exclude from update. These packages are excluded by + // using the yum `--exclude` flag. + repeated string excludes = 3; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field must not be specified with any other patch + // configuration fields. + repeated string exclusive_packages = 4; +} + +// Googet patching is performed by running `googet update`. +message GooSettings {} + +// Zypper patching is performed by running `zypper patch`. +// See also https://en.opensuse.org/SDB:Zypper_manual. +message ZypperSettings { + // Adds the `--with-optional` flag to `zypper patch`. + bool with_optional = 1; + + // Adds the `--with-update` flag, to `zypper patch`. + bool with_update = 2; + + // Install only patches with these categories. + // Common categories include security, recommended, and feature. + repeated string categories = 3; + + // Install only patches with these severities. + // Common severities include critical, important, moderate, and low. + repeated string severities = 4; + + // List of patches to exclude from update. + repeated string excludes = 5; + + // An exclusive list of patches to be updated. These are the only patches + // that will be installed using 'zypper patch patch:' command. + // This field must not be used with any other patch configuration fields. + repeated string exclusive_patches = 6; +} + +// Windows patching is performed using the Windows Update Agent. +message WindowsUpdateSettings { + // Microsoft Windows update classifications as defined in + // [1] + // https://support.microsoft.com/en-us/help/824684/description-of-the-standard-terminology-that-is-used-to-describe-micro + enum Classification { + // Invalid. If classifications are included, they must be specified. + CLASSIFICATION_UNSPECIFIED = 0; + + // "A widely released fix for a specific problem that addresses a critical, + // non-security-related bug." [1] + CRITICAL = 1; + + // "A widely released fix for a product-specific, security-related + // vulnerability. Security vulnerabilities are rated by their severity. The + // severity rating is indicated in the Microsoft security bulletin as + // critical, important, moderate, or low." [1] + SECURITY = 2; + + // "A widely released and frequent software update that contains additions + // to a product's definition database. Definition databases are often used + // to detect objects that have specific attributes, such as malicious code, + // phishing websites, or junk mail." [1] + DEFINITION = 3; + + // "Software that controls the input and output of a device." [1] + DRIVER = 4; + + // "New product functionality that is first distributed outside the context + // of a product release and that is typically included in the next full + // product release." [1] + FEATURE_PACK = 5; + + // "A tested, cumulative set of all hotfixes, security updates, critical + // updates, and updates. Additionally, service packs may contain additional + // fixes for problems that are found internally since the release of the + // product. Service packs my also contain a limited number of + // customer-requested design changes or features." [1] + SERVICE_PACK = 6; + + // "A utility or feature that helps complete a task or set of tasks." [1] + TOOL = 7; + + // "A tested, cumulative set of hotfixes, security updates, critical + // updates, and updates that are packaged together for easy deployment. A + // rollup generally targets a specific area, such as security, or a + // component of a product, such as Internet Information Services (IIS)." [1] + UPDATE_ROLLUP = 8; + + // "A widely released fix for a specific problem. An update addresses a + // noncritical, non-security-related bug." [1] + UPDATE = 9; + } + + // Only apply updates of these windows update classifications. If empty, all + // updates are applied. + repeated Classification classifications = 1; + + // List of KBs to exclude from update. + repeated string excludes = 2; + + // An exclusive list of kbs to be updated. These are the only patches + // that will be updated. This field must not be used with other + // patch configurations. + repeated string exclusive_patches = 3; +} + +// A step that runs an executable for a PatchJob. +message ExecStep { + // The ExecStepConfig for all Linux VMs targeted by the PatchJob. + ExecStepConfig linux_exec_step_config = 1; + + // The ExecStepConfig for all Windows VMs targeted by the PatchJob. + ExecStepConfig windows_exec_step_config = 2; +} + +// Common configurations for an ExecStep. +message ExecStepConfig { + // The interpreter used to execute the a file. + enum Interpreter { + // Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the + // interpreter will be parsed from the shebang line of the script if + // unspecified. + INTERPRETER_UNSPECIFIED = 0; + + // Indicates that the script is run with `/bin/sh` on Linux and `cmd` + // on Windows. + SHELL = 1; + + // Indicates that the file is run with PowerShell flags + // `-NonInteractive`, `-NoProfile`, and `-ExecutionPolicy Bypass`. + POWERSHELL = 2; + } + + // Location of the executable. + oneof executable { + // An absolute path to the executable on the VM. + string local_path = 1; + + // A Cloud Storage object containing the executable. + GcsObject gcs_object = 2; + } + + // Defaults to [0]. A list of possible return values that the + // execution can return to indicate a success. + repeated int32 allowed_success_codes = 3; + + // The script interpreter to use to run the script. If no interpreter is + // specified the script will be executed directly, which will likely + // only succeed for scripts with [shebang lines] + // (https://en.wikipedia.org/wiki/Shebang_\(Unix\)). + Interpreter interpreter = 4; +} + +// Cloud Storage object representation. +message GcsObject { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Generation number of the Cloud Storage object. This is used to + // ensure that the ExecStep specified by this PatchJob does not change. + int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A filter to target VM instances for patching. The targeted +// VMs must meet all criteria specified. So if both labels and zones are +// specified, the patch job targets only VMs with those labels and in those +// zones. +message PatchInstanceFilter { + // Targets a group of VM instances by using their [assigned + // labels](https://cloud.google.com/compute/docs/labeling-resources). Labels + // are key-value pairs. A `GroupLabel` is a combination of labels + // that is used to target VMs for a patch job. + // + // For example, a patch job can target VMs that have the following + // `GroupLabel`: `{"env":"test", "app":"web"}`. This means that the patch job + // is applied to VMs that have both the labels `env=test` and `app=web`. + message GroupLabel { + // Compute Engine instance labels that must be present for a VM + // instance to be targeted by this filter. + map labels = 1; + } + + // Target all VM instances in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // Targets VM instances matching ANY of these GroupLabels. This allows + // targeting of disparate groups of VM instances. + repeated GroupLabel group_labels = 2; + + // Targets VM instances in ANY of these zones. Leave empty to target VM + // instances in any zone. + repeated string zones = 3; + + // Targets any of the VM instances specified. Instances are specified by their + // URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`, + // `projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or + // `https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]` + repeated string instances = 4; + + // Targets VMs whose name starts with one of these prefixes. Similar to + // labels, this is another way to group VMs when targeting configs, for + // example prefix="prod-". + repeated string instance_name_prefixes = 5; +} + +// Patch rollout configuration specifications. Contains details on the +// concurrency control when applying patch(es) to all targeted VMs. +message PatchRollout { + // Type of the rollout. + enum Mode { + // Mode must be specified. + MODE_UNSPECIFIED = 0; + + // Patches are applied one zone at a time. The patch job begins in the + // region with the lowest number of targeted VMs. Within the region, + // patching begins in the zone with the lowest number of targeted VMs. If + // multiple regions (or zones within a region) have the same number of + // targeted VMs, a tie-breaker is achieved by sorting the regions or zones + // in alphabetical order. + ZONE_BY_ZONE = 1; + + // Patches are applied to VMs in all zones at the same time. + CONCURRENT_ZONES = 2; + } + + // Mode of the patch rollout. + Mode mode = 1; + + // The maximum number (or percentage) of VMs per zone to disrupt at any given + // moment. The number of VMs calculated from multiplying the percentage by the + // total number of VMs in a zone is rounded up. + // + // During patching, a VM is considered disrupted from the time the agent is + // notified to begin until patching has completed. This disruption time + // includes the time to complete reboot and any post-patch steps. + // + // A VM contributes to the disruption budget if its patching operation fails + // either when applying the patches, running pre or post patch steps, or if it + // fails to respond with a success notification before timing out. VMs that + // are not running or do not have an active agent do not count toward this + // disruption budget. + // + // For zone-by-zone rollouts, if the disruption budget in a zone is exceeded, + // the patch job stops, because continuing to the next zone requires + // completion of the patch process in the previous zone. + // + // For example, if the disruption budget has a fixed value of `10`, and 8 VMs + // fail to patch in the current zone, the patch job continues to patch 2 VMs + // at a time until the zone is completed. When that zone is completed + // successfully, patching begins with 10 VMs at a time in the next zone. If 10 + // VMs in the next zone fail to patch, the patch job stops. + FixedOrPercent disruption_budget = 2; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 7ed21b94829..dc57ee03015 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -3888,7 +3888,8 @@ export namespace google { RESOURCE = 1, IAM_POLICY = 2, ORG_POLICY = 4, - ACCESS_POLICY = 5 + ACCESS_POLICY = 5, + OS_INVENTORY = 6 } /** Properties of a TemporalAsset. */ @@ -4143,6 +4144,9 @@ export namespace google { /** Asset servicePerimeter */ servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** Asset osInventory */ + osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** Asset ancestors */ ancestors?: (string[]|null); } @@ -4183,6 +4187,9 @@ export namespace google { /** Asset servicePerimeter. */ public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** Asset osInventory. */ + public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** Asset ancestors. */ public ancestors: string[]; @@ -12437,6 +12444,1080 @@ export namespace google { } } } + + /** Namespace osconfig. */ + namespace osconfig { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an Inventory. */ + interface IInventory { + + /** Inventory osInfo */ + osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); + + /** Inventory items */ + items?: ({ [k: string]: google.cloud.osconfig.v1.Inventory.IItem }|null); + } + + /** Represents an Inventory. */ + class Inventory implements IInventory { + + /** + * Constructs a new Inventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IInventory); + + /** Inventory osInfo. */ + public osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); + + /** Inventory items. */ + public items: { [k: string]: google.cloud.osconfig.v1.Inventory.IItem }; + + /** + * Creates a new Inventory instance using the specified properties. + * @param [properties] Properties to set + * @returns Inventory instance + */ + public static create(properties?: google.cloud.osconfig.v1.IInventory): google.cloud.osconfig.v1.Inventory; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Inventory + * @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; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Inventory + * @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; + + /** + * Verifies an Inventory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Inventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @param message Inventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Inventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Inventory { + + /** Properties of an OsInfo. */ + interface IOsInfo { + + /** OsInfo hostname */ + hostname?: (string|null); + + /** OsInfo longName */ + longName?: (string|null); + + /** OsInfo shortName */ + shortName?: (string|null); + + /** OsInfo version */ + version?: (string|null); + + /** OsInfo architecture */ + architecture?: (string|null); + + /** OsInfo kernelVersion */ + kernelVersion?: (string|null); + + /** OsInfo kernelRelease */ + kernelRelease?: (string|null); + + /** OsInfo osconfigAgentVersion */ + osconfigAgentVersion?: (string|null); + } + + /** Represents an OsInfo. */ + class OsInfo implements IOsInfo { + + /** + * Constructs a new OsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IOsInfo); + + /** OsInfo hostname. */ + public hostname: string; + + /** OsInfo longName. */ + public longName: string; + + /** OsInfo shortName. */ + public shortName: string; + + /** OsInfo version. */ + public version: string; + + /** OsInfo architecture. */ + public architecture: string; + + /** OsInfo kernelVersion. */ + public kernelVersion: string; + + /** OsInfo kernelRelease. */ + public kernelRelease: string; + + /** OsInfo osconfigAgentVersion. */ + public osconfigAgentVersion: string; + + /** + * Creates a new OsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OsInfo instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IOsInfo): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsInfo + * @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.OsInfo; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsInfo + * @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.OsInfo; + + /** + * Verifies an OsInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @param message OsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.OsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Item. */ + interface IItem { + + /** Item id */ + id?: (string|null); + + /** Item originType */ + originType?: (google.cloud.osconfig.v1.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1.Inventory.Item.OriginType|null); + + /** Item createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type */ + type?: (google.cloud.osconfig.v1.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1.Inventory.Item.Type|null); + + /** Item installedPackage */ + installedPackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item availablePackage */ + availablePackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IItem); + + /** Item id. */ + public id: string; + + /** Item originType. */ + public originType: (google.cloud.osconfig.v1.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1.Inventory.Item.OriginType); + + /** Item createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type. */ + public type: (google.cloud.osconfig.v1.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1.Inventory.Item.Type); + + /** Item installedPackage. */ + public installedPackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item availablePackage. */ + public availablePackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item details. */ + public details?: ("installedPackage"|"availablePackage"); + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IItem): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @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.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @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.Item; + + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Item { + + /** OriginType enum. */ + enum OriginType { + ORIGIN_TYPE_UNSPECIFIED = 0, + INVENTORY_REPORT = 1 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + INSTALLED_PACKAGE = 1, + AVAILABLE_PACKAGE = 2 + } + } + + /** Properties of a SoftwarePackage. */ + interface ISoftwarePackage { + + /** SoftwarePackage yumPackage */ + yumPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage */ + aptPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage */ + zypperPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage */ + googetPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch */ + zypperPatch?: (google.cloud.osconfig.v1.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage */ + wuaPackage?: (google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage */ + qfePackage?: (google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage */ + cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + } + + /** Represents a SoftwarePackage. */ + class SoftwarePackage implements ISoftwarePackage { + + /** + * Constructs a new SoftwarePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.ISoftwarePackage); + + /** SoftwarePackage yumPackage. */ + public yumPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage. */ + public aptPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage. */ + public zypperPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage. */ + public googetPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch. */ + public zypperPatch?: (google.cloud.osconfig.v1.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage. */ + public wuaPackage?: (google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage. */ + public qfePackage?: (google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage. */ + public cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage details. */ + public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns SoftwarePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.ISoftwarePackage): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoftwarePackage + * @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.SoftwarePackage; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoftwarePackage + * @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.SoftwarePackage; + + /** + * Verifies a SoftwarePackage 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 SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoftwarePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @param message SoftwarePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.SoftwarePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoftwarePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VersionedPackage. */ + interface IVersionedPackage { + + /** VersionedPackage packageName */ + packageName?: (string|null); + + /** VersionedPackage architecture */ + architecture?: (string|null); + + /** VersionedPackage version */ + version?: (string|null); + } + + /** Represents a VersionedPackage. */ + class VersionedPackage implements IVersionedPackage { + + /** + * Constructs a new VersionedPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IVersionedPackage); + + /** VersionedPackage packageName. */ + public packageName: string; + + /** VersionedPackage architecture. */ + public architecture: string; + + /** VersionedPackage version. */ + public version: string; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IVersionedPackage): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedPackage + * @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.VersionedPackage; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedPackage + * @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.VersionedPackage; + + /** + * Verifies a VersionedPackage 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 VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @param message VersionedPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.VersionedPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionedPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WindowsUpdatePackage. */ + interface IWindowsUpdatePackage { + + /** WindowsUpdatePackage title */ + title?: (string|null); + + /** WindowsUpdatePackage description */ + description?: (string|null); + + /** WindowsUpdatePackage categories */ + categories?: (google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]|null); + + /** WindowsUpdatePackage kbArticleIds */ + kbArticleIds?: (string[]|null); + + /** WindowsUpdatePackage supportUrl */ + supportUrl?: (string|null); + + /** WindowsUpdatePackage moreInfoUrls */ + moreInfoUrls?: (string[]|null); + + /** WindowsUpdatePackage updateId */ + updateId?: (string|null); + + /** WindowsUpdatePackage revisionNumber */ + revisionNumber?: (number|null); + + /** WindowsUpdatePackage lastDeploymentChangeTime */ + lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsUpdatePackage. */ + class WindowsUpdatePackage implements IWindowsUpdatePackage { + + /** + * Constructs a new WindowsUpdatePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage); + + /** WindowsUpdatePackage title. */ + public title: string; + + /** WindowsUpdatePackage description. */ + public description: string; + + /** WindowsUpdatePackage categories. */ + public categories: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]; + + /** WindowsUpdatePackage kbArticleIds. */ + public kbArticleIds: string[]; + + /** WindowsUpdatePackage supportUrl. */ + public supportUrl: string; + + /** WindowsUpdatePackage moreInfoUrls. */ + public moreInfoUrls: string[]; + + /** WindowsUpdatePackage updateId. */ + public updateId: string; + + /** WindowsUpdatePackage revisionNumber. */ + public revisionNumber: number; + + /** WindowsUpdatePackage lastDeploymentChangeTime. */ + public lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdatePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdatePackage + * @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.WindowsUpdatePackage; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdatePackage + * @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.WindowsUpdatePackage; + + /** + * Verifies a WindowsUpdatePackage 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 WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdatePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @param message WindowsUpdatePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WindowsUpdatePackage { + + /** Properties of a WindowsUpdateCategory. */ + interface IWindowsUpdateCategory { + + /** WindowsUpdateCategory id */ + id?: (string|null); + + /** WindowsUpdateCategory name */ + name?: (string|null); + } + + /** Represents a WindowsUpdateCategory. */ + class WindowsUpdateCategory implements IWindowsUpdateCategory { + + /** + * Constructs a new WindowsUpdateCategory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory); + + /** WindowsUpdateCategory id. */ + public id: string; + + /** WindowsUpdateCategory name. */ + public name: string; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdateCategory instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdateCategory + * @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.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdateCategory + * @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.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Verifies a WindowsUpdateCategory 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 WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdateCategory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @param message WindowsUpdateCategory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @returns JSON object + */ + 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 WindowsQuickFixEngineeringPackage. */ + interface IWindowsQuickFixEngineeringPackage { + + /** WindowsQuickFixEngineeringPackage caption */ + caption?: (string|null); + + /** WindowsQuickFixEngineeringPackage description */ + description?: (string|null); + + /** WindowsQuickFixEngineeringPackage hotFixId */ + hotFixId?: (string|null); + + /** WindowsQuickFixEngineeringPackage installTime */ + installTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsQuickFixEngineeringPackage. */ + class WindowsQuickFixEngineeringPackage implements IWindowsQuickFixEngineeringPackage { + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage); + + /** WindowsQuickFixEngineeringPackage caption. */ + public caption: string; + + /** WindowsQuickFixEngineeringPackage description. */ + public description: string; + + /** WindowsQuickFixEngineeringPackage hotFixId. */ + public hotFixId: string; + + /** WindowsQuickFixEngineeringPackage installTime. */ + public installTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsQuickFixEngineeringPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsQuickFixEngineeringPackage + * @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.WindowsQuickFixEngineeringPackage; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsQuickFixEngineeringPackage + * @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.WindowsQuickFixEngineeringPackage; + + /** + * Verifies a WindowsQuickFixEngineeringPackage 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 WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsQuickFixEngineeringPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @param message WindowsQuickFixEngineeringPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } } /** Namespace api. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index c77b139d6f5..1bfa136dfc5 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -678,6 +678,7 @@ case 2: case 4: case 5: + case 6: break; } if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { @@ -735,6 +736,10 @@ case 5: message.contentType = 5; break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; } if (object.outputConfig != null) { if (typeof object.outputConfig !== "object") @@ -1237,6 +1242,7 @@ case 2: case 4: case 5: + case 6: break; } if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { @@ -1289,6 +1295,10 @@ case 5: message.contentType = 5; break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; } if (object.readTimeWindow != null) { if (typeof object.readTimeWindow !== "object") @@ -4806,6 +4816,7 @@ case 2: case 4: case 5: + case 6: break; } if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { @@ -4870,6 +4881,10 @@ case 5: message.contentType = 5; break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; } if (object.feedOutputConfig != null) { if (typeof object.feedOutputConfig !== "object") @@ -9067,6 +9082,7 @@ * @property {number} IAM_POLICY=2 IAM_POLICY value * @property {number} ORG_POLICY=4 ORG_POLICY value * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + * @property {number} OS_INVENTORY=6 OS_INVENTORY value */ v1.ContentType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -9075,6 +9091,7 @@ values[valuesById[2] = "IAM_POLICY"] = 2; values[valuesById[4] = "ORG_POLICY"] = 4; values[valuesById[5] = "ACCESS_POLICY"] = 5; + values[valuesById[6] = "OS_INVENTORY"] = 6; return values; })(); @@ -9652,6 +9669,7 @@ * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {google.cloud.osconfig.v1.IInventory|null} [osInventory] Asset osInventory * @property {Array.|null} [ancestors] Asset ancestors */ @@ -9744,6 +9762,14 @@ */ Asset.prototype.servicePerimeter = null; + /** + * Asset osInventory. + * @member {google.cloud.osconfig.v1.IInventory|null|undefined} osInventory + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.osInventory = null; + /** * Asset ancestors. * @member {Array.} ancestors @@ -9812,6 +9838,8 @@ writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.osInventory != null && Object.hasOwnProperty.call(message, "osInventory")) + $root.google.cloud.osconfig.v1.Inventory.encode(message.osInventory, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; @@ -9875,6 +9903,9 @@ case 9: message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); break; + case 12: + message.osInventory = $root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32()); + break; case 10: if (!(message.ancestors && message.ancestors.length)) message.ancestors = []; @@ -9974,6 +10005,11 @@ return "servicePerimeter." + error; } } + if (message.osInventory != null && message.hasOwnProperty("osInventory")) { + var error = $root.google.cloud.osconfig.v1.Inventory.verify(message.osInventory); + if (error) + return "osInventory." + error; + } if (message.ancestors != null && message.hasOwnProperty("ancestors")) { if (!Array.isArray(message.ancestors)) return "ancestors: array expected"; @@ -10040,6 +10076,11 @@ throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); } + if (object.osInventory != null) { + if (typeof object.osInventory !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.osInventory: object expected"); + message.osInventory = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.osInventory); + } if (object.ancestors) { if (!Array.isArray(object.ancestors)) throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); @@ -10073,6 +10114,7 @@ object.resource = null; object.iamPolicy = null; object.updateTime = null; + object.osInventory = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -10109,6 +10151,8 @@ } if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.osInventory != null && message.hasOwnProperty("osInventory")) + object.osInventory = $root.google.cloud.osconfig.v1.Inventory.toObject(message.osInventory, options); return object; }; @@ -30081,6 +30125,2885 @@ return orgpolicy; })(); + cloud.osconfig = (function() { + + /** + * Namespace osconfig. + * @memberof google.cloud + * @namespace + */ + var osconfig = {}; + + osconfig.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.osconfig + * @namespace + */ + var v1 = {}; + + v1.Inventory = (function() { + + /** + * Properties of an Inventory. + * @memberof google.cloud.osconfig.v1 + * @interface IInventory + * @property {google.cloud.osconfig.v1.Inventory.IOsInfo|null} [osInfo] Inventory osInfo + * @property {Object.|null} [items] Inventory items + */ + + /** + * Constructs a new Inventory. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an Inventory. + * @implements IInventory + * @constructor + * @param {google.cloud.osconfig.v1.IInventory=} [properties] Properties to set + */ + function Inventory(properties) { + this.items = {}; + 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 osInfo. + * @member {google.cloud.osconfig.v1.Inventory.IOsInfo|null|undefined} osInfo + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.osInfo = null; + + /** + * Inventory items. + * @member {Object.} items + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.items = $util.emptyObject; + + /** + * Creates a new Inventory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory} Inventory instance + */ + Inventory.create = function create(properties) { + return new Inventory(properties); + }; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osInfo != null && Object.hasOwnProperty.call(message, "osInfo")) + $root.google.cloud.osconfig.v1.Inventory.OsInfo.encode(message.osInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + 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(); + } + return writer; + }; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory + * @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} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.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(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.decode(reader, reader.uint32()); + break; + case 2: + if (message.items === $util.emptyObject) + message.items = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.osconfig.v1.Inventory.Item.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Inventory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Inventory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osInfo != null && message.hasOwnProperty("osInfo")) { + var error = $root.google.cloud.osconfig.v1.Inventory.OsInfo.verify(message.osInfo); + if (error) + return "osInfo." + error; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.Item.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + */ + Inventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory(); + if (object.osInfo != null) { + if (typeof object.osInfo !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.osInfo: object expected"); + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.fromObject(object.osInfo); + } + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.items: object expected"); + message.items[keys[i]] = $root.google.cloud.osconfig.v1.Inventory.Item.fromObject(object.items[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.Inventory} message Inventory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Inventory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.items = {}; + if (options.defaults) + object.osInfo = null; + if (message.osInfo != null && message.hasOwnProperty("osInfo")) + object.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.toObject(message.osInfo, options); + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + 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); + } + return object; + }; + + /** + * Converts this Inventory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + * @returns {Object.} JSON object + */ + Inventory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Inventory.OsInfo = (function() { + + /** + * Properties of an OsInfo. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IOsInfo + * @property {string|null} [hostname] OsInfo hostname + * @property {string|null} [longName] OsInfo longName + * @property {string|null} [shortName] OsInfo shortName + * @property {string|null} [version] OsInfo version + * @property {string|null} [architecture] OsInfo architecture + * @property {string|null} [kernelVersion] OsInfo kernelVersion + * @property {string|null} [kernelRelease] OsInfo kernelRelease + * @property {string|null} [osconfigAgentVersion] OsInfo osconfigAgentVersion + */ + + /** + * Constructs a new OsInfo. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents an OsInfo. + * @implements IOsInfo + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo=} [properties] Properties to set + */ + function OsInfo(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]]; + } + + /** + * OsInfo hostname. + * @member {string} hostname + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.hostname = ""; + + /** + * OsInfo longName. + * @member {string} longName + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.longName = ""; + + /** + * OsInfo shortName. + * @member {string} shortName + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.shortName = ""; + + /** + * OsInfo version. + * @member {string} version + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.version = ""; + + /** + * OsInfo architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.architecture = ""; + + /** + * OsInfo kernelVersion. + * @member {string} kernelVersion + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelVersion = ""; + + /** + * OsInfo kernelRelease. + * @member {string} kernelRelease + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelRelease = ""; + + /** + * OsInfo osconfigAgentVersion. + * @member {string} osconfigAgentVersion + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.osconfigAgentVersion = ""; + + /** + * Creates a new OsInfo instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo instance + */ + OsInfo.create = function create(properties) { + return new OsInfo(properties); + }; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.longName != null && Object.hasOwnProperty.call(message, "longName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.longName); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shortName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.architecture); + if (message.kernelVersion != null && Object.hasOwnProperty.call(message, "kernelVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kernelVersion); + if (message.kernelRelease != null && Object.hasOwnProperty.call(message, "kernelRelease")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kernelRelease); + if (message.osconfigAgentVersion != null && Object.hasOwnProperty.call(message, "osconfigAgentVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.osconfigAgentVersion); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.hostname); + return writer; + }; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @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.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.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.OsInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: + message.hostname = reader.string(); + break; + case 2: + message.longName = reader.string(); + break; + case 3: + message.shortName = reader.string(); + break; + case 4: + message.version = reader.string(); + break; + case 5: + message.architecture = reader.string(); + break; + case 6: + message.kernelVersion = reader.string(); + break; + case 7: + message.kernelRelease = reader.string(); + break; + case 8: + message.osconfigAgentVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsInfo message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.longName != null && message.hasOwnProperty("longName")) + if (!$util.isString(message.longName)) + return "longName: string expected"; + if (message.shortName != null && message.hasOwnProperty("shortName")) + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + if (!$util.isString(message.kernelVersion)) + return "kernelVersion: string expected"; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + if (!$util.isString(message.kernelRelease)) + return "kernelRelease: string expected"; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + if (!$util.isString(message.osconfigAgentVersion)) + return "osconfigAgentVersion: string expected"; + return null; + }; + + /** + * Creates an OsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + */ + OsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.OsInfo) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.OsInfo(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.longName != null) + message.longName = String(object.longName); + if (object.shortName != null) + message.shortName = String(object.shortName); + if (object.version != null) + message.version = String(object.version); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.kernelVersion != null) + message.kernelVersion = String(object.kernelVersion); + if (object.kernelRelease != null) + message.kernelRelease = String(object.kernelRelease); + if (object.osconfigAgentVersion != null) + message.osconfigAgentVersion = String(object.osconfigAgentVersion); + return message; + }; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.OsInfo} message OsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.longName = ""; + object.shortName = ""; + object.version = ""; + object.architecture = ""; + object.kernelVersion = ""; + object.kernelRelease = ""; + object.osconfigAgentVersion = ""; + object.hostname = ""; + } + if (message.longName != null && message.hasOwnProperty("longName")) + object.longName = message.longName; + if (message.shortName != null && message.hasOwnProperty("shortName")) + object.shortName = message.shortName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + object.kernelVersion = message.kernelVersion; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + object.kernelRelease = message.kernelRelease; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + object.osconfigAgentVersion = message.osconfigAgentVersion; + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + return object; + }; + + /** + * Converts this OsInfo to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + * @returns {Object.} JSON object + */ + OsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OsInfo; + })(); + + Inventory.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IItem + * @property {string|null} [id] Item id + * @property {google.cloud.osconfig.v1.Inventory.Item.OriginType|null} [originType] Item originType + * @property {google.protobuf.ITimestamp|null} [createTime] Item createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Item updateTime + * @property {google.cloud.osconfig.v1.Inventory.Item.Type|null} [type] Item type + * @property {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null} [installedPackage] Item installedPackage + * @property {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null} [availablePackage] Item availablePackage + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IItem=} [properties] Properties to set + */ + function Item(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]]; + } + + /** + * Item id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.id = ""; + + /** + * Item originType. + * @member {google.cloud.osconfig.v1.Inventory.Item.OriginType} originType + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.originType = 0; + + /** + * Item createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.createTime = null; + + /** + * Item updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.updateTime = null; + + /** + * Item type. + * @member {google.cloud.osconfig.v1.Inventory.Item.Type} type + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.type = 0; + + /** + * Item installedPackage. + * @member {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null|undefined} installedPackage + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.installedPackage = null; + + /** + * Item availablePackage. + * @member {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null|undefined} availablePackage + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.availablePackage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Item details. + * @member {"installedPackage"|"availablePackage"|undefined} details + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Object.defineProperty(Item.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["installedPackage", "availablePackage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.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.originType != null && Object.hasOwnProperty.call(message, "originType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.originType); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.installedPackage != null && Object.hasOwnProperty.call(message, "installedPackage")) + $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.encode(message.installedPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.availablePackage != null && Object.hasOwnProperty.call(message, "availablePackage")) + $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.encode(message.availablePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @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.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.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.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.originType = reader.int32(); + break; + case 8: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + case 7: + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.originType != null && message.hasOwnProperty("originType")) + switch (message.originType) { + default: + return "originType: enum value expected"; + case 0: + case 1: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify(message.installedPackage); + if (error) + return "installedPackage." + error; + } + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify(message.availablePackage); + if (error) + return "availablePackage." + error; + } + } + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.Item) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.Item(); + if (object.id != null) + message.id = String(object.id); + switch (object.originType) { + case "ORIGIN_TYPE_UNSPECIFIED": + case 0: + message.originType = 0; + break; + case "INVENTORY_REPORT": + case 1: + message.originType = 1; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSTALLED_PACKAGE": + case 1: + message.type = 1; + break; + case "AVAILABLE_PACKAGE": + case 2: + message.type = 2; + break; + } + if (object.installedPackage != null) { + if (typeof object.installedPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.installedPackage: object expected"); + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.fromObject(object.installedPackage); + } + if (object.availablePackage != null) { + if (typeof object.availablePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.availablePackage: object expected"); + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.fromObject(object.availablePackage); + } + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.originType = options.enums === String ? "ORIGIN_TYPE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.originType != null && message.hasOwnProperty("originType")) + object.originType = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] : message.originType; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] : message.type; + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + object.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.installedPackage, options); + if (options.oneofs) + object.details = "installedPackage"; + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + object.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.availablePackage, options); + if (options.oneofs) + object.details = "availablePackage"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OriginType enum. + * @name google.cloud.osconfig.v1.Inventory.Item.OriginType + * @enum {number} + * @property {number} ORIGIN_TYPE_UNSPECIFIED=0 ORIGIN_TYPE_UNSPECIFIED value + * @property {number} INVENTORY_REPORT=1 INVENTORY_REPORT value + */ + Item.OriginType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGIN_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INVENTORY_REPORT"] = 1; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.osconfig.v1.Inventory.Item.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} INSTALLED_PACKAGE=1 INSTALLED_PACKAGE value + * @property {number} AVAILABLE_PACKAGE=2 AVAILABLE_PACKAGE value + */ + Item.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLED_PACKAGE"] = 1; + values[valuesById[2] = "AVAILABLE_PACKAGE"] = 2; + return values; + })(); + + return Item; + })(); + + Inventory.SoftwarePackage = (function() { + + /** + * Properties of a SoftwarePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface ISoftwarePackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [yumPackage] SoftwarePackage yumPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [aptPackage] SoftwarePackage aptPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [zypperPackage] SoftwarePackage zypperPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [googetPackage] SoftwarePackage googetPackage + * @property {google.cloud.osconfig.v1.Inventory.IZypperPatch|null} [zypperPatch] SoftwarePackage zypperPatch + * @property {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null} [wuaPackage] SoftwarePackage wuaPackage + * @property {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null} [qfePackage] SoftwarePackage qfePackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [cosPackage] SoftwarePackage cosPackage + */ + + /** + * Constructs a new SoftwarePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a SoftwarePackage. + * @implements ISoftwarePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage=} [properties] Properties to set + */ + function SoftwarePackage(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]]; + } + + /** + * SoftwarePackage yumPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} yumPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.yumPackage = null; + + /** + * SoftwarePackage aptPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} aptPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.aptPackage = null; + + /** + * SoftwarePackage zypperPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} zypperPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPackage = null; + + /** + * SoftwarePackage googetPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} googetPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.googetPackage = null; + + /** + * SoftwarePackage zypperPatch. + * @member {google.cloud.osconfig.v1.Inventory.IZypperPatch|null|undefined} zypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPatch = null; + + /** + * SoftwarePackage wuaPackage. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null|undefined} wuaPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.wuaPackage = null; + + /** + * SoftwarePackage qfePackage. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null|undefined} qfePackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.qfePackage = null; + + /** + * SoftwarePackage cosPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} cosPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.cosPackage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SoftwarePackage details. + * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|undefined} details + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + Object.defineProperty(SoftwarePackage.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage instance + */ + SoftwarePackage.create = function create(properties) { + return new SoftwarePackage(properties); + }; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yumPackage != null && Object.hasOwnProperty.call(message, "yumPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.yumPackage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aptPackage != null && Object.hasOwnProperty.call(message, "aptPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.aptPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zypperPackage != null && Object.hasOwnProperty.call(message, "zypperPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.zypperPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googetPackage != null && Object.hasOwnProperty.call(message, "googetPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.googetPackage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.zypperPatch != null && Object.hasOwnProperty.call(message, "zypperPatch")) + $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.encode(message.zypperPatch, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.wuaPackage != null && Object.hasOwnProperty.call(message, "wuaPackage")) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.encode(message.wuaPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.qfePackage != null && Object.hasOwnProperty.call(message, "qfePackage")) + $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.encode(message.qfePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cosPackage != null && Object.hasOwnProperty.call(message, "cosPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.cosPackage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @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.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.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.SoftwarePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + case 2: + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + case 3: + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + case 4: + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + case 5: + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.decode(reader, reader.uint32()); + break; + case 6: + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.decode(reader, reader.uint32()); + break; + case 7: + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.decode(reader, reader.uint32()); + break; + case 8: + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwarePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwarePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.yumPackage); + if (error) + return "yumPackage." + error; + } + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.aptPackage); + if (error) + return "aptPackage." + error; + } + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.zypperPackage); + if (error) + return "zypperPackage." + error; + } + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.googetPackage); + if (error) + return "googetPackage." + error; + } + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.verify(message.zypperPatch); + if (error) + return "zypperPatch." + error; + } + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify(message.wuaPackage); + if (error) + return "wuaPackage." + error; + } + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify(message.qfePackage); + if (error) + return "qfePackage." + error; + } + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.cosPackage); + if (error) + return "cosPackage." + error; + } + } + return null; + }; + + /** + * Creates a SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + */ + SoftwarePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage(); + if (object.yumPackage != null) { + if (typeof object.yumPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.yumPackage: object expected"); + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.yumPackage); + } + if (object.aptPackage != null) { + if (typeof object.aptPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.aptPackage: object expected"); + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.aptPackage); + } + if (object.zypperPackage != null) { + if (typeof object.zypperPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.zypperPackage: object expected"); + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.zypperPackage); + } + if (object.googetPackage != null) { + if (typeof object.googetPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.googetPackage: object expected"); + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.googetPackage); + } + if (object.zypperPatch != null) { + if (typeof object.zypperPatch !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.zypperPatch: object expected"); + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.fromObject(object.zypperPatch); + } + if (object.wuaPackage != null) { + if (typeof object.wuaPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.wuaPackage: object expected"); + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.fromObject(object.wuaPackage); + } + if (object.qfePackage != null) { + if (typeof object.qfePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.qfePackage: object expected"); + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.fromObject(object.qfePackage); + } + if (object.cosPackage != null) { + if (typeof object.cosPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.cosPackage: object expected"); + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.cosPackage); + } + return message; + }; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.SoftwarePackage} message SoftwarePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwarePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + object.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.yumPackage, options); + if (options.oneofs) + object.details = "yumPackage"; + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + object.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.aptPackage, options); + if (options.oneofs) + object.details = "aptPackage"; + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + object.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.zypperPackage, options); + if (options.oneofs) + object.details = "zypperPackage"; + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + object.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.googetPackage, options); + if (options.oneofs) + object.details = "googetPackage"; + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + object.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.toObject(message.zypperPatch, options); + if (options.oneofs) + object.details = "zypperPatch"; + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + object.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.toObject(message.wuaPackage, options); + if (options.oneofs) + object.details = "wuaPackage"; + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + object.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.toObject(message.qfePackage, options); + if (options.oneofs) + object.details = "qfePackage"; + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + object.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.cosPackage, options); + if (options.oneofs) + object.details = "cosPackage"; + } + return object; + }; + + /** + * Converts this SoftwarePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + * @returns {Object.} JSON object + */ + SoftwarePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SoftwarePackage; + })(); + + Inventory.VersionedPackage = (function() { + + /** + * Properties of a VersionedPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IVersionedPackage + * @property {string|null} [packageName] VersionedPackage packageName + * @property {string|null} [architecture] VersionedPackage architecture + * @property {string|null} [version] VersionedPackage version + */ + + /** + * Constructs a new VersionedPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a VersionedPackage. + * @implements IVersionedPackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage=} [properties] Properties to set + */ + function VersionedPackage(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]]; + } + + /** + * VersionedPackage packageName. + * @member {string} packageName + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.packageName = ""; + + /** + * VersionedPackage architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.architecture = ""; + + /** + * VersionedPackage version. + * @member {string} version + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.version = ""; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage instance + */ + VersionedPackage.create = function create(properties) { + return new VersionedPackage(properties); + }; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.architecture); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageName); + return writer; + }; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @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.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.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.VersionedPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.packageName = reader.string(); + break; + case 2: + message.architecture = reader.string(); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionedPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionedPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageName != null && message.hasOwnProperty("packageName")) + if (!$util.isString(message.packageName)) + return "packageName: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + */ + VersionedPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.VersionedPackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.VersionedPackage(); + if (object.packageName != null) + message.packageName = String(object.packageName); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.VersionedPackage} message VersionedPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionedPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.architecture = ""; + object.version = ""; + object.packageName = ""; + } + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.packageName != null && message.hasOwnProperty("packageName")) + object.packageName = message.packageName; + return object; + }; + + /** + * Converts this VersionedPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + * @returns {Object.} JSON object + */ + VersionedPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionedPackage; + })(); + + Inventory.WindowsUpdatePackage = (function() { + + /** + * 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 + */ + + /** + * 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]]; + } + + /** + * 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 + * @instance + */ + WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; + + /** + * WindowsUpdatePackage updateId. + * @member {string} updateId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.updateId = ""; + + /** + * WindowsUpdatePackage revisionNumber. + * @member {number} revisionNumber + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.revisionNumber = 0; + + /** + * WindowsUpdatePackage lastDeploymentChangeTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance + */ + WindowsUpdatePackage.create = function create(properties) { + return new WindowsUpdatePackage(properties); + }; + + /** + * 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.WindowsUpdatePackage + * @static + * @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 + */ + WindowsUpdatePackage.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); + return writer; + }; + + /** + * 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.WindowsUpdatePackage + * @static + * @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 + */ + WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @function decode + * @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.WindowsUpdatePackage} WindowsUpdatePackage + * @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) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = 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())); + 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()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @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.WindowsUpdatePackage} WindowsUpdatePackage + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdatePackage message. + * @function verify + * @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 + */ + WindowsUpdatePackage.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; + } + return null; + }; + + /** + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + */ + 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.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 WindowsUpdatePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + 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.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]; + } + 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.WindowsUpdatePackage + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdatePackage.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 + */ + + /** + * 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.ZypperPatch = (function() { + + /** + * 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 + */ + + /** + * 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 + */ + 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]]; + } + + /** + * ZypperPatch patchName. + * @member {string} patchName + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.patchName = ""; + + /** + * ZypperPatch category. + * @member {string} category + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.category = ""; + + /** + * ZypperPatch severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.severity = ""; + + /** + * ZypperPatch summary. + * @member {string} summary + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.summary = ""; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch instance + */ + ZypperPatch.create = function create(properties) { + return new ZypperPatch(properties); + }; + + /** + * 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.ZypperPatch + * @static + * @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 + */ + ZypperPatch.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); + return writer; + }; + + /** + * 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.ZypperPatch + * @static + * @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 + */ + ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @function decode + * @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.ZypperPatch} ZypperPatch + * @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) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.patchName = reader.string(); + break; + case 2: + message.category = reader.string(); + break; + case 3: + message.severity = reader.string(); + break; + case 4: + message.summary = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @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.ZypperPatch} ZypperPatch + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZypperPatch message. + * @function verify + * @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 + */ + ZypperPatch.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"; + return null; + }; + + /** + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + */ + 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.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 ZypperPatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.ZypperPatch} message ZypperPatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZypperPatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = ""; + object.severity = ""; + object.summary = ""; + object.patchName = ""; + } + 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. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + * @returns {Object.} JSON object + */ + ZypperPatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ZypperPatch; + })(); + + Inventory.WindowsQuickFixEngineeringPackage = (function() { + + /** + * Properties of a WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsQuickFixEngineeringPackage + * @property {string|null} [caption] WindowsQuickFixEngineeringPackage caption + * @property {string|null} [description] WindowsQuickFixEngineeringPackage description + * @property {string|null} [hotFixId] WindowsQuickFixEngineeringPackage hotFixId + * @property {google.protobuf.ITimestamp|null} [installTime] WindowsQuickFixEngineeringPackage installTime + */ + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsQuickFixEngineeringPackage. + * @implements IWindowsQuickFixEngineeringPackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + */ + function WindowsQuickFixEngineeringPackage(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]]; + } + + /** + * WindowsQuickFixEngineeringPackage caption. + * @member {string} caption + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.caption = ""; + + /** + * WindowsQuickFixEngineeringPackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.description = ""; + + /** + * WindowsQuickFixEngineeringPackage hotFixId. + * @member {string} hotFixId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.hotFixId = ""; + + /** + * WindowsQuickFixEngineeringPackage installTime. + * @member {google.protobuf.ITimestamp|null|undefined} installTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.installTime = null; + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage instance + */ + WindowsQuickFixEngineeringPackage.create = function create(properties) { + return new WindowsQuickFixEngineeringPackage(properties); + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caption); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.hotFixId != null && Object.hasOwnProperty.call(message, "hotFixId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hotFixId); + if (message.installTime != null && Object.hasOwnProperty.call(message, "installTime")) + $root.google.protobuf.Timestamp.encode(message.installTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @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.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.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.WindowsQuickFixEngineeringPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.caption = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.hotFixId = reader.string(); + break; + case 5: + message.installTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsQuickFixEngineeringPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsQuickFixEngineeringPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + if (!$util.isString(message.hotFixId)) + return "hotFixId: string expected"; + if (message.installTime != null && message.hasOwnProperty("installTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.installTime); + if (error) + return "installTime." + error; + } + return null; + }; + + /** + * Creates a WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + */ + WindowsQuickFixEngineeringPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage(); + if (object.caption != null) + message.caption = String(object.caption); + if (object.description != null) + message.description = String(object.description); + if (object.hotFixId != null) + message.hotFixId = String(object.hotFixId); + if (object.installTime != null) { + if (typeof object.installTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.installTime: object expected"); + message.installTime = $root.google.protobuf.Timestamp.fromObject(object.installTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsQuickFixEngineeringPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.caption = ""; + object.description = ""; + object.hotFixId = ""; + object.installTime = null; + } + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + object.hotFixId = message.hotFixId; + if (message.installTime != null && message.hasOwnProperty("installTime")) + object.installTime = $root.google.protobuf.Timestamp.toObject(message.installTime, options); + return object; + }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + * @returns {Object.} JSON object + */ + WindowsQuickFixEngineeringPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WindowsQuickFixEngineeringPackage; + })(); + + return Inventory; + })(); + + return v1; + })(); + + return osconfig; + })(); + return cloud; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index cbdc8c237fc..3a4fbe31000 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -971,7 +971,8 @@ "RESOURCE": 1, "IAM_POLICY": 2, "ORG_POLICY": 4, - "ACCESS_POLICY": 5 + "ACCESS_POLICY": 5, + "OS_INVENTORY": 6 } }, "TemporalAsset": { @@ -1073,6 +1074,10 @@ "type": "google.identity.accesscontextmanager.v1.ServicePerimeter", "id": 9 }, + "osInventory": { + "type": "google.cloud.osconfig.v1.Inventory", + "id": 12 + }, "ancestors": { "rule": "repeated", "type": "string", @@ -3009,6 +3014,292 @@ } } } + }, + "osconfig": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OsConfig.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig", + "java_multiple_files": true, + "java_outer_classname": "Inventories", + "java_package": "com.google.cloud.osconfig.v1", + "php_namespace": "Google\\Cloud\\OsConfig\\V1", + "ruby_package": "Google::Cloud::OsConfig::V1" + }, + "nested": { + "Inventory": { + "fields": { + "osInfo": { + "type": "OsInfo", + "id": 1 + }, + "items": { + "keyType": "string", + "type": "Item", + "id": 2 + } + }, + "nested": { + "OsInfo": { + "fields": { + "hostname": { + "type": "string", + "id": 9 + }, + "longName": { + "type": "string", + "id": 2 + }, + "shortName": { + "type": "string", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 5 + }, + "kernelVersion": { + "type": "string", + "id": 6 + }, + "kernelRelease": { + "type": "string", + "id": 7 + }, + "osconfigAgentVersion": { + "type": "string", + "id": 8 + } + } + }, + "Item": { + "oneofs": { + "details": { + "oneof": [ + "installedPackage", + "availablePackage" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "originType": { + "type": "OriginType", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "type": { + "type": "Type", + "id": 5 + }, + "installedPackage": { + "type": "SoftwarePackage", + "id": 6 + }, + "availablePackage": { + "type": "SoftwarePackage", + "id": 7 + } + }, + "nested": { + "OriginType": { + "values": { + "ORIGIN_TYPE_UNSPECIFIED": 0, + "INVENTORY_REPORT": 1 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "INSTALLED_PACKAGE": 1, + "AVAILABLE_PACKAGE": 2 + } + } + } + }, + "SoftwarePackage": { + "oneofs": { + "details": { + "oneof": [ + "yumPackage", + "aptPackage", + "zypperPackage", + "googetPackage", + "zypperPatch", + "wuaPackage", + "qfePackage", + "cosPackage" + ] + } + }, + "fields": { + "yumPackage": { + "type": "VersionedPackage", + "id": 1 + }, + "aptPackage": { + "type": "VersionedPackage", + "id": 2 + }, + "zypperPackage": { + "type": "VersionedPackage", + "id": 3 + }, + "googetPackage": { + "type": "VersionedPackage", + "id": 4 + }, + "zypperPatch": { + "type": "ZypperPatch", + "id": 5 + }, + "wuaPackage": { + "type": "WindowsUpdatePackage", + "id": 6 + }, + "qfePackage": { + "type": "WindowsQuickFixEngineeringPackage", + "id": 7 + }, + "cosPackage": { + "type": "VersionedPackage", + "id": 8 + } + } + }, + "VersionedPackage": { + "fields": { + "packageName": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 2 + }, + "version": { + "type": "string", + "id": 3 + } + } + }, + "WindowsUpdatePackage": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "categories": { + "rule": "repeated", + "type": "WindowsUpdateCategory", + "id": 3 + }, + "kbArticleIds": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "supportUrl": { + "type": "string", + "id": 11 + }, + "moreInfoUrls": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "updateId": { + "type": "string", + "id": 6 + }, + "revisionNumber": { + "type": "int32", + "id": 7 + }, + "lastDeploymentChangeTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "WindowsUpdateCategory": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + } + } + }, + "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": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "hotFixId": { + "type": "string", + "id": 3 + }, + "installTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + } + } + } + } + } + } } } }, 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 04c7dca517a..e21378ae23c 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class AssetServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -100,7 +106,9 @@ export class AssetServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -376,7 +384,7 @@ export class AssetServiceClient { // ------------------- batchGetAssetsHistory( request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, @@ -386,7 +394,7 @@ export class AssetServiceClient { >; batchGetAssetsHistory( request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest @@ -451,7 +459,7 @@ export class AssetServiceClient { batchGetAssetsHistory( request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest @@ -474,12 +482,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -494,7 +502,7 @@ export class AssetServiceClient { } createFeed( request: protos.google.cloud.asset.v1.ICreateFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IFeed, @@ -504,7 +512,7 @@ export class AssetServiceClient { >; createFeed( request: protos.google.cloud.asset.v1.ICreateFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, @@ -553,7 +561,7 @@ export class AssetServiceClient { createFeed( request: protos.google.cloud.asset.v1.ICreateFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, @@ -572,12 +580,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -592,7 +600,7 @@ export class AssetServiceClient { } getFeed( request: protos.google.cloud.asset.v1.IGetFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IFeed, @@ -602,7 +610,7 @@ export class AssetServiceClient { >; getFeed( request: protos.google.cloud.asset.v1.IGetFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, @@ -640,7 +648,7 @@ export class AssetServiceClient { getFeed( request: protos.google.cloud.asset.v1.IGetFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, @@ -659,12 +667,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -679,7 +687,7 @@ export class AssetServiceClient { } listFeeds( request: protos.google.cloud.asset.v1.IListFeedsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IListFeedsResponse, @@ -689,7 +697,7 @@ export class AssetServiceClient { >; listFeeds( request: protos.google.cloud.asset.v1.IListFeedsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IListFeedsResponse, protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, @@ -726,7 +734,7 @@ export class AssetServiceClient { listFeeds( request: protos.google.cloud.asset.v1.IListFeedsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IListFeedsResponse, protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, @@ -745,12 +753,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -765,7 +773,7 @@ export class AssetServiceClient { } updateFeed( request: protos.google.cloud.asset.v1.IUpdateFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IFeed, @@ -775,7 +783,7 @@ export class AssetServiceClient { >; updateFeed( request: protos.google.cloud.asset.v1.IUpdateFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, @@ -818,7 +826,7 @@ export class AssetServiceClient { updateFeed( request: protos.google.cloud.asset.v1.IUpdateFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, @@ -837,12 +845,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -857,7 +865,7 @@ export class AssetServiceClient { } deleteFeed( request: protos.google.cloud.asset.v1.IDeleteFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -867,7 +875,7 @@ export class AssetServiceClient { >; deleteFeed( request: protos.google.cloud.asset.v1.IDeleteFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, @@ -905,7 +913,7 @@ export class AssetServiceClient { deleteFeed( request: protos.google.cloud.asset.v1.IDeleteFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, @@ -924,12 +932,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -944,7 +952,7 @@ export class AssetServiceClient { } analyzeIamPolicy( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, @@ -954,7 +962,7 @@ export class AssetServiceClient { >; analyzeIamPolicy( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, @@ -1001,7 +1009,7 @@ export class AssetServiceClient { analyzeIamPolicy( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, | protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest @@ -1022,12 +1030,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1043,7 +1051,7 @@ export class AssetServiceClient { exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1056,7 +1064,7 @@ export class AssetServiceClient { >; exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.asset.v1.IExportAssetsResponse, @@ -1142,7 +1150,7 @@ export class AssetServiceClient { exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.asset.v1.IExportAssetsResponse, @@ -1170,12 +1178,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1227,7 +1235,7 @@ export class AssetServiceClient { } analyzeIamPolicyLongrunning( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1240,7 +1248,7 @@ export class AssetServiceClient { >; analyzeIamPolicyLongrunning( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, @@ -1294,7 +1302,7 @@ export class AssetServiceClient { analyzeIamPolicyLongrunning( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, @@ -1322,12 +1330,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1383,7 +1391,7 @@ export class AssetServiceClient { } searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IResourceSearchResult[], @@ -1393,7 +1401,7 @@ export class AssetServiceClient { >; searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1.ISearchAllResourcesRequest, | protos.google.cloud.asset.v1.ISearchAllResourcesResponse @@ -1507,7 +1515,7 @@ export class AssetServiceClient { searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1.ISearchAllResourcesRequest, | protos.google.cloud.asset.v1.ISearchAllResourcesResponse @@ -1530,12 +1538,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1638,7 +1646,7 @@ export class AssetServiceClient { */ searchAllResourcesStream( request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1753,7 +1761,7 @@ export class AssetServiceClient { */ searchAllResourcesAsync( request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -1775,7 +1783,7 @@ export class AssetServiceClient { } searchAllIamPolicies( request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IIamPolicySearchResult[], @@ -1785,7 +1793,7 @@ export class AssetServiceClient { >; searchAllIamPolicies( request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse @@ -1878,7 +1886,7 @@ export class AssetServiceClient { searchAllIamPolicies( request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse @@ -1901,12 +1909,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1988,7 +1996,7 @@ export class AssetServiceClient { */ searchAllIamPoliciesStream( request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2082,7 +2090,7 @@ export class AssetServiceClient { */ searchAllIamPoliciesAsync( request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index bc32ce5a590..6138a67083b 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -27,6 +28,11 @@ import { import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -80,9 +86,9 @@ export class AssetServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -95,7 +101,9 @@ export class AssetServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -310,7 +318,7 @@ export class AssetServiceClient { // ------------------- batchGetAssetsHistory( request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, @@ -323,7 +331,7 @@ export class AssetServiceClient { >; batchGetAssetsHistory( request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest @@ -388,7 +396,7 @@ export class AssetServiceClient { batchGetAssetsHistory( request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest @@ -414,12 +422,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -435,7 +443,7 @@ export class AssetServiceClient { exportAssets( request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -448,7 +456,7 @@ export class AssetServiceClient { >; exportAssets( request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.asset.v1beta1.IExportAssetsResponse, @@ -517,7 +525,7 @@ export class AssetServiceClient { exportAssets( request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.asset.v1beta1.IExportAssetsResponse, @@ -545,12 +553,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 1f40241c597..f352accc24a 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -30,6 +31,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -82,9 +88,9 @@ export class AssetServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -97,7 +103,9 @@ export class AssetServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -301,7 +309,7 @@ export class AssetServiceClient { searchAllResources( request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], @@ -311,7 +319,7 @@ export class AssetServiceClient { >; searchAllResources( request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse @@ -383,7 +391,7 @@ export class AssetServiceClient { searchAllResources( request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse @@ -406,12 +414,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -470,7 +478,7 @@ export class AssetServiceClient { */ searchAllResourcesStream( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -541,7 +549,7 @@ export class AssetServiceClient { */ searchAllResourcesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -563,7 +571,7 @@ export class AssetServiceClient { } searchAllIamPolicies( request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], @@ -573,7 +581,7 @@ export class AssetServiceClient { >; searchAllIamPolicies( request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse @@ -640,7 +648,7 @@ export class AssetServiceClient { searchAllIamPolicies( request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse @@ -663,12 +671,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -722,7 +730,7 @@ export class AssetServiceClient { */ searchAllIamPoliciesStream( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -788,7 +796,7 @@ export class AssetServiceClient { */ searchAllIamPoliciesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index f06289a9209..6cb8aca1662 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -16,11 +16,17 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1p2beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -74,9 +80,9 @@ export class AssetServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -89,7 +95,9 @@ export class AssetServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -294,7 +302,7 @@ export class AssetServiceClient { // ------------------- createFeed( request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p2beta1.IFeed, @@ -304,7 +312,7 @@ export class AssetServiceClient { >; createFeed( request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, @@ -353,7 +361,7 @@ export class AssetServiceClient { createFeed( request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p2beta1.IFeed, | protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest @@ -374,12 +382,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -394,7 +402,7 @@ export class AssetServiceClient { } getFeed( request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p2beta1.IFeed, @@ -404,7 +412,7 @@ export class AssetServiceClient { >; getFeed( request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | null | undefined, @@ -442,7 +450,7 @@ export class AssetServiceClient { getFeed( request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p2beta1.IFeed, | protos.google.cloud.asset.v1p2beta1.IGetFeedRequest @@ -463,12 +471,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -483,7 +491,7 @@ export class AssetServiceClient { } listFeeds( request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, @@ -493,7 +501,7 @@ export class AssetServiceClient { >; listFeeds( request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | null | undefined, @@ -530,7 +538,7 @@ export class AssetServiceClient { listFeeds( request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, | protos.google.cloud.asset.v1p2beta1.IListFeedsRequest @@ -551,12 +559,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -571,7 +579,7 @@ export class AssetServiceClient { } updateFeed( request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p2beta1.IFeed, @@ -581,7 +589,7 @@ export class AssetServiceClient { >; updateFeed( request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | null | undefined, @@ -624,7 +632,7 @@ export class AssetServiceClient { updateFeed( request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p2beta1.IFeed, | protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest @@ -645,12 +653,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -665,7 +673,7 @@ export class AssetServiceClient { } deleteFeed( request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -675,7 +683,7 @@ export class AssetServiceClient { >; deleteFeed( request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | null | undefined, @@ -713,7 +721,7 @@ export class AssetServiceClient { deleteFeed( request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest @@ -734,12 +742,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 6380744f67b..a54fea9a2fd 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -27,6 +28,11 @@ import { import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1p4beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -80,9 +86,9 @@ export class AssetServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -95,7 +101,9 @@ export class AssetServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -317,7 +325,7 @@ export class AssetServiceClient { // ------------------- analyzeIamPolicy( request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, @@ -327,7 +335,7 @@ export class AssetServiceClient { >; analyzeIamPolicy( request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, | protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest @@ -369,7 +377,7 @@ export class AssetServiceClient { analyzeIamPolicy( request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, | protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest @@ -392,12 +400,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -413,7 +421,7 @@ export class AssetServiceClient { exportIamPolicyAnalysis( request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -426,7 +434,7 @@ export class AssetServiceClient { >; exportIamPolicyAnalysis( request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, @@ -477,7 +485,7 @@ export class AssetServiceClient { exportIamPolicyAnalysis( request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, @@ -505,12 +513,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 3072e67d686..d42164a70e5 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -30,6 +31,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1p5beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -82,9 +88,9 @@ export class AssetServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -97,7 +103,9 @@ export class AssetServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -293,7 +301,7 @@ export class AssetServiceClient { listAssets( request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p5beta1.IAsset[], @@ -303,7 +311,7 @@ export class AssetServiceClient { >; listAssets( request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse @@ -371,7 +379,7 @@ export class AssetServiceClient { listAssets( request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse @@ -394,12 +402,12 @@ export class AssetServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -458,7 +466,7 @@ export class AssetServiceClient { */ listAssetsStream( request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -529,7 +537,7 @@ export class AssetServiceClient { */ listAssetsAsync( request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index a9684364814..d27ce42d660 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "3d6d4cea05c0f87f9780a63ec59d4f17cf5667d1" + "sha": "c2f5a16b062667889e3dfe66f5bf1335e1704420" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b759c563bacf9cd15749be4d2bdd276d3f48ee29", - "internalRef": "341102751" + "sha": "a578b42319ca0e3c7b6fec600a4ee9ec57443598", + "internalRef": "344904496" } }, {