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

namespace Google\Cloud\AppEngine\V1;

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

/**
 * Health checking configuration for VM instances. Unhealthy instances
 * are killed and replaced with new instances.
 *
 * Generated from protobuf message <code>google.appengine.v1.LivenessCheck</code>
 */
class LivenessCheck extends \Google\Protobuf\Internal\Message
{
    /**
     * The request path.
     *
     * Generated from protobuf field <code>string path = 1;</code>
     */
    private $path = '';
    /**
     * Host header to send when performing a HTTP Liveness check.
     * Example: "myapp.appspot.com"
     *
     * Generated from protobuf field <code>string host = 2;</code>
     */
    private $host = '';
    /**
     * Number of consecutive failed checks required before considering the
     * VM unhealthy.
     *
     * Generated from protobuf field <code>uint32 failure_threshold = 3;</code>
     */
    private $failure_threshold = 0;
    /**
     * Number of consecutive successful checks required before considering
     * the VM healthy.
     *
     * Generated from protobuf field <code>uint32 success_threshold = 4;</code>
     */
    private $success_threshold = 0;
    /**
     * Interval between health checks.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration check_interval = 5;</code>
     */
    private $check_interval = null;
    /**
     * Time before the check is considered failed.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration timeout = 6;</code>
     */
    private $timeout = null;
    /**
     * The initial delay before starting to execute the checks.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration initial_delay = 7;</code>
     */
    private $initial_delay = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $path
     *           The request path.
     *     @type string $host
     *           Host header to send when performing a HTTP Liveness check.
     *           Example: "myapp.appspot.com"
     *     @type int $failure_threshold
     *           Number of consecutive failed checks required before considering the
     *           VM unhealthy.
     *     @type int $success_threshold
     *           Number of consecutive successful checks required before considering
     *           the VM healthy.
     *     @type \Google\Protobuf\Duration $check_interval
     *           Interval between health checks.
     *     @type \Google\Protobuf\Duration $timeout
     *           Time before the check is considered failed.
     *     @type \Google\Protobuf\Duration $initial_delay
     *           The initial delay before starting to execute the checks.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Appengine\V1\AppYaml::initOnce();
        parent::__construct($data);
    }

    /**
     * The request path.
     *
     * Generated from protobuf field <code>string path = 1;</code>
     * @return string
     */
    public function getPath()
    {
        return $this->path;
    }

    /**
     * The request path.
     *
     * Generated from protobuf field <code>string path = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPath($var)
    {
        GPBUtil::checkString($var, True);
        $this->path = $var;

        return $this;
    }

    /**
     * Host header to send when performing a HTTP Liveness check.
     * Example: "myapp.appspot.com"
     *
     * Generated from protobuf field <code>string host = 2;</code>
     * @return string
     */
    public function getHost()
    {
        return $this->host;
    }

    /**
     * Host header to send when performing a HTTP Liveness check.
     * Example: "myapp.appspot.com"
     *
     * Generated from protobuf field <code>string host = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setHost($var)
    {
        GPBUtil::checkString($var, True);
        $this->host = $var;

        return $this;
    }

    /**
     * Number of consecutive failed checks required before considering the
     * VM unhealthy.
     *
     * Generated from protobuf field <code>uint32 failure_threshold = 3;</code>
     * @return int
     */
    public function getFailureThreshold()
    {
        return $this->failure_threshold;
    }

    /**
     * Number of consecutive failed checks required before considering the
     * VM unhealthy.
     *
     * Generated from protobuf field <code>uint32 failure_threshold = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setFailureThreshold($var)
    {
        GPBUtil::checkUint32($var);
        $this->failure_threshold = $var;

        return $this;
    }

    /**
     * Number of consecutive successful checks required before considering
     * the VM healthy.
     *
     * Generated from protobuf field <code>uint32 success_threshold = 4;</code>
     * @return int
     */
    public function getSuccessThreshold()
    {
        return $this->success_threshold;
    }

    /**
     * Number of consecutive successful checks required before considering
     * the VM healthy.
     *
     * Generated from protobuf field <code>uint32 success_threshold = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setSuccessThreshold($var)
    {
        GPBUtil::checkUint32($var);
        $this->success_threshold = $var;

        return $this;
    }

    /**
     * Interval between health checks.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration check_interval = 5;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getCheckInterval()
    {
        return isset($this->check_interval) ? $this->check_interval : null;
    }

    public function hasCheckInterval()
    {
        return isset($this->check_interval);
    }

    public function clearCheckInterval()
    {
        unset($this->check_interval);
    }

    /**
     * Interval between health checks.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration check_interval = 5;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setCheckInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->check_interval = $var;

        return $this;
    }

    /**
     * Time before the check is considered failed.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration timeout = 6;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getTimeout()
    {
        return isset($this->timeout) ? $this->timeout : null;
    }

    public function hasTimeout()
    {
        return isset($this->timeout);
    }

    public function clearTimeout()
    {
        unset($this->timeout);
    }

    /**
     * Time before the check is considered failed.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration timeout = 6;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->timeout = $var;

        return $this;
    }

    /**
     * The initial delay before starting to execute the checks.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration initial_delay = 7;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getInitialDelay()
    {
        return isset($this->initial_delay) ? $this->initial_delay : null;
    }

    public function hasInitialDelay()
    {
        return isset($this->initial_delay);
    }

    public function clearInitialDelay()
    {
        unset($this->initial_delay);
    }

    /**
     * The initial delay before starting to execute the checks.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration initial_delay = 7;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setInitialDelay($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->initial_delay = $var;

        return $this;
    }

}

