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

namespace Google\Cloud\OsConfig\V1;

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

/**
 * 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).
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.PatchDeployment</code>
 */
class PatchDeployment extends \Google\Protobuf\Internal\Message
{
    /**
     * 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.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Optional. Description of the patch deployment. Length of the description is
     * limited to 1024 characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $description = '';
    /**
     * Required. VM instances to patch.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchInstanceFilter instance_filter = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $instance_filter = null;
    /**
     * Optional. Patch configuration that is applied.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchConfig patch_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $patch_config = null;
    /**
     * Optional. Duration of the patch. After the duration ends, the patch times
     * out.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $duration = null;
    /**
     * Output only. Time the patch deployment was created. Timestamp is in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. Time the patch deployment was last updated. Timestamp is in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;
    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_execute_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $last_execute_time = null;
    /**
     * Optional. Rollout strategy of the patch job.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchRollout rollout = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $rollout = null;
    /**
     * Output only. Current state of the patch deployment.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchDeployment.State state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    protected $schedule;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           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.
     *     @type string $description
     *           Optional. Description of the patch deployment. Length of the description is
     *           limited to 1024 characters.
     *     @type \Google\Cloud\OsConfig\V1\PatchInstanceFilter $instance_filter
     *           Required. VM instances to patch.
     *     @type \Google\Cloud\OsConfig\V1\PatchConfig $patch_config
     *           Optional. Patch configuration that is applied.
     *     @type \Google\Protobuf\Duration $duration
     *           Optional. Duration of the patch. After the duration ends, the patch times
     *           out.
     *     @type \Google\Cloud\OsConfig\V1\OneTimeSchedule $one_time_schedule
     *           Required. Schedule a one-time execution.
     *     @type \Google\Cloud\OsConfig\V1\RecurringSchedule $recurring_schedule
     *           Required. Schedule recurring executions.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Time the patch deployment was created. Timestamp is in
     *           [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. Time the patch deployment was last updated. Timestamp is in
     *           [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *     @type \Google\Protobuf\Timestamp $last_execute_time
     *           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.
     *     @type \Google\Cloud\OsConfig\V1\PatchRollout $rollout
     *           Optional. Rollout strategy of the patch job.
     *     @type int $state
     *           Output only. Current state of the patch deployment.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\PatchDeployments::initOnce();
        parent::__construct($data);
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. Description of the patch deployment. Length of the description is
     * limited to 1024 characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. Description of the patch deployment. Length of the description is
     * limited to 1024 characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Required. VM instances to patch.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchInstanceFilter instance_filter = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\OsConfig\V1\PatchInstanceFilter|null
     */
    public function getInstanceFilter()
    {
        return $this->instance_filter;
    }

    public function hasInstanceFilter()
    {
        return isset($this->instance_filter);
    }

    public function clearInstanceFilter()
    {
        unset($this->instance_filter);
    }

    /**
     * Required. VM instances to patch.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchInstanceFilter instance_filter = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\OsConfig\V1\PatchInstanceFilter $var
     * @return $this
     */
    public function setInstanceFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\PatchInstanceFilter::class);
        $this->instance_filter = $var;

        return $this;
    }

    /**
     * Optional. Patch configuration that is applied.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchConfig patch_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\OsConfig\V1\PatchConfig|null
     */
    public function getPatchConfig()
    {
        return $this->patch_config;
    }

    public function hasPatchConfig()
    {
        return isset($this->patch_config);
    }

    public function clearPatchConfig()
    {
        unset($this->patch_config);
    }

    /**
     * Optional. Patch configuration that is applied.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchConfig patch_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\OsConfig\V1\PatchConfig $var
     * @return $this
     */
    public function setPatchConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\PatchConfig::class);
        $this->patch_config = $var;

        return $this;
    }

    /**
     * Optional. Duration of the patch. After the duration ends, the patch times
     * out.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getDuration()
    {
        return $this->duration;
    }

    public function hasDuration()
    {
        return isset($this->duration);
    }

    public function clearDuration()
    {
        unset($this->duration);
    }

    /**
     * Optional. Duration of the patch. After the duration ends, the patch times
     * out.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->duration = $var;

        return $this;
    }

    /**
     * Required. Schedule a one-time execution.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OneTimeSchedule one_time_schedule = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\OsConfig\V1\OneTimeSchedule|null
     */
    public function getOneTimeSchedule()
    {
        return $this->readOneof(6);
    }

    public function hasOneTimeSchedule()
    {
        return $this->hasOneof(6);
    }

    /**
     * Required. Schedule a one-time execution.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OneTimeSchedule one_time_schedule = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\OsConfig\V1\OneTimeSchedule $var
     * @return $this
     */
    public function setOneTimeSchedule($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\OneTimeSchedule::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Required. Schedule recurring executions.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.RecurringSchedule recurring_schedule = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\OsConfig\V1\RecurringSchedule|null
     */
    public function getRecurringSchedule()
    {
        return $this->readOneof(7);
    }

    public function hasRecurringSchedule()
    {
        return $this->hasOneof(7);
    }

    /**
     * Required. Schedule recurring executions.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.RecurringSchedule recurring_schedule = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\OsConfig\V1\RecurringSchedule $var
     * @return $this
     */
    public function setRecurringSchedule($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\RecurringSchedule::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Output only. Time the patch deployment was created. Timestamp is in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</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);
    }

    /**
     * Output only. Time the patch deployment was created. Timestamp is in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</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;
    }

    /**
     * Output only. Time the patch deployment was last updated. Timestamp is in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9 [(.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. Time the patch deployment was last updated. Timestamp is in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9 [(.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;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_execute_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastExecuteTime()
    {
        return $this->last_execute_time;
    }

    public function hasLastExecuteTime()
    {
        return isset($this->last_execute_time);
    }

    public function clearLastExecuteTime()
    {
        unset($this->last_execute_time);
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_execute_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastExecuteTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_execute_time = $var;

        return $this;
    }

    /**
     * Optional. Rollout strategy of the patch job.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchRollout rollout = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\OsConfig\V1\PatchRollout|null
     */
    public function getRollout()
    {
        return $this->rollout;
    }

    public function hasRollout()
    {
        return isset($this->rollout);
    }

    public function clearRollout()
    {
        unset($this->rollout);
    }

    /**
     * Optional. Rollout strategy of the patch job.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchRollout rollout = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\OsConfig\V1\PatchRollout $var
     * @return $this
     */
    public function setRollout($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\PatchRollout::class);
        $this->rollout = $var;

        return $this;
    }

    /**
     * Output only. Current state of the patch deployment.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchDeployment.State state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. Current state of the patch deployment.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.PatchDeployment.State state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\OsConfig\V1\PatchDeployment\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getSchedule()
    {
        return $this->whichOneof("schedule");
    }

}

