<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/osconfig/v1/vulnerability.proto

namespace Google\Cloud\OsConfig\V1\VulnerabilityReport;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A vulnerability affecting the VM instance.
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability</code>
 */
class Vulnerability extends \Google\Protobuf\Internal\Message
{
    /**
     * Contains metadata as per the upstream feed of the operating system and
     * NVD.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1;</code>
     */
    private $details = null;
    /**
     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
     * This field displays the inventory items affected by this vulnerability.
     * If the vulnerability report was not updated after the VM inventory
     * update, these values might not display in VM inventory. For some distros,
     * this field may be empty.
     *
     * Generated from protobuf field <code>repeated string installed_inventory_item_ids = 2 [deprecated = true];</code>
     * @deprecated
     */
    private $installed_inventory_item_ids;
    /**
     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
     * If the vulnerability report was not updated after the VM inventory
     * update, these values might not display in VM inventory. If there is no
     * available fix, the field is empty. The `inventory_item` value specifies
     * the latest `SoftwarePackage` available to the VM that fixes the
     * vulnerability.
     *
     * Generated from protobuf field <code>repeated string available_inventory_item_ids = 3 [deprecated = true];</code>
     * @deprecated
     */
    private $available_inventory_item_ids;
    /**
     * The timestamp for when the vulnerability was first detected.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4;</code>
     */
    private $create_time = null;
    /**
     * The timestamp for when the vulnerability was last modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5;</code>
     */
    private $update_time = null;
    /**
     * List of items affected by the vulnerability.
     *
     * Generated from protobuf field <code>repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item items = 6;</code>
     */
    private $items;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability\Details $details
     *           Contains metadata as per the upstream feed of the operating system and
     *           NVD.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $installed_inventory_item_ids
     *           Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
     *           This field displays the inventory items affected by this vulnerability.
     *           If the vulnerability report was not updated after the VM inventory
     *           update, these values might not display in VM inventory. For some distros,
     *           this field may be empty.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $available_inventory_item_ids
     *           Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
     *           If the vulnerability report was not updated after the VM inventory
     *           update, these values might not display in VM inventory. If there is no
     *           available fix, the field is empty. The `inventory_item` value specifies
     *           the latest `SoftwarePackage` available to the VM that fixes the
     *           vulnerability.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           The timestamp for when the vulnerability was first detected.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           The timestamp for when the vulnerability was last modified.
     *     @type array<\Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability\Item>|\Google\Protobuf\Internal\RepeatedField $items
     *           List of items affected by the vulnerability.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\Vulnerability::initOnce();
        parent::__construct($data);
    }

    /**
     * Contains metadata as per the upstream feed of the operating system and
     * NVD.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1;</code>
     * @return \Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability\Details|null
     */
    public function getDetails()
    {
        return $this->details;
    }

    public function hasDetails()
    {
        return isset($this->details);
    }

    public function clearDetails()
    {
        unset($this->details);
    }

    /**
     * Contains metadata as per the upstream feed of the operating system and
     * NVD.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1;</code>
     * @param \Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability\Details $var
     * @return $this
     */
    public function setDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability\Details::class);
        $this->details = $var;

        return $this;
    }

    /**
     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
     * This field displays the inventory items affected by this vulnerability.
     * If the vulnerability report was not updated after the VM inventory
     * update, these values might not display in VM inventory. For some distros,
     * this field may be empty.
     *
     * Generated from protobuf field <code>repeated string installed_inventory_item_ids = 2 [deprecated = true];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     * @deprecated
     */
    public function getInstalledInventoryItemIds()
    {
        @trigger_error('installed_inventory_item_ids is deprecated.', E_USER_DEPRECATED);
        return $this->installed_inventory_item_ids;
    }

    /**
     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
     * This field displays the inventory items affected by this vulnerability.
     * If the vulnerability report was not updated after the VM inventory
     * update, these values might not display in VM inventory. For some distros,
     * this field may be empty.
     *
     * Generated from protobuf field <code>repeated string installed_inventory_item_ids = 2 [deprecated = true];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     * @deprecated
     */
    public function setInstalledInventoryItemIds($var)
    {
        @trigger_error('installed_inventory_item_ids is deprecated.', E_USER_DEPRECATED);
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->installed_inventory_item_ids = $arr;

        return $this;
    }

    /**
     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
     * If the vulnerability report was not updated after the VM inventory
     * update, these values might not display in VM inventory. If there is no
     * available fix, the field is empty. The `inventory_item` value specifies
     * the latest `SoftwarePackage` available to the VM that fixes the
     * vulnerability.
     *
     * Generated from protobuf field <code>repeated string available_inventory_item_ids = 3 [deprecated = true];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     * @deprecated
     */
    public function getAvailableInventoryItemIds()
    {
        @trigger_error('available_inventory_item_ids is deprecated.', E_USER_DEPRECATED);
        return $this->available_inventory_item_ids;
    }

    /**
     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
     * If the vulnerability report was not updated after the VM inventory
     * update, these values might not display in VM inventory. If there is no
     * available fix, the field is empty. The `inventory_item` value specifies
     * the latest `SoftwarePackage` available to the VM that fixes the
     * vulnerability.
     *
     * Generated from protobuf field <code>repeated string available_inventory_item_ids = 3 [deprecated = true];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     * @deprecated
     */
    public function setAvailableInventoryItemIds($var)
    {
        @trigger_error('available_inventory_item_ids is deprecated.', E_USER_DEPRECATED);
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->available_inventory_item_ids = $arr;

        return $this;
    }

    /**
     * The timestamp for when the vulnerability was first detected.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * The timestamp for when the vulnerability was first detected.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * The timestamp for when the vulnerability was last modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * The timestamp for when the vulnerability was last modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * List of items affected by the vulnerability.
     *
     * Generated from protobuf field <code>repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item items = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getItems()
    {
        return $this->items;
    }

    /**
     * List of items affected by the vulnerability.
     *
     * Generated from protobuf field <code>repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item items = 6;</code>
     * @param array<\Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability\Item>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setItems($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability\Item::class);
        $this->items = $arr;

        return $this;
    }

}


