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

namespace Google\Cloud\OsConfig\V1;

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

/**
 * This API resource represents the vulnerability report for a specified
 * Compute Engine virtual machine (VM) instance at a given point in time.
 * For more information, see [Vulnerability
 * reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports).
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.VulnerabilityReport</code>
 */
class VulnerabilityReport extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The `vulnerabilityReport` API resource name.
     * Format:
     * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Output only. List of vulnerabilities affecting the VM.
     *
     * Generated from protobuf field <code>repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $vulnerabilities;
    /**
     * Output only. The timestamp for when the last vulnerability report was generated for the
     * VM.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The `vulnerabilityReport` API resource name.
     *           Format:
     *           `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
     *     @type array<\Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability>|\Google\Protobuf\Internal\RepeatedField $vulnerabilities
     *           Output only. List of vulnerabilities affecting the VM.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The timestamp for when the last vulnerability report was generated for the
     *           VM.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\Vulnerability::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The `vulnerabilityReport` API resource name.
     * Format:
     * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The `vulnerabilityReport` API resource name.
     * Format:
     * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. List of vulnerabilities affecting the VM.
     *
     * Generated from protobuf field <code>repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getVulnerabilities()
    {
        return $this->vulnerabilities;
    }

    /**
     * Output only. List of vulnerabilities affecting the VM.
     *
     * Generated from protobuf field <code>repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setVulnerabilities($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OsConfig\V1\VulnerabilityReport\Vulnerability::class);
        $this->vulnerabilities = $arr;

        return $this;
    }

    /**
     * Output only. The timestamp for when the last vulnerability report was generated for the
     * VM.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</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);
    }

    /**
     * Output only. The timestamp for when the last vulnerability report was generated for the
     * VM.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</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;
    }

}

