<?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;

/**
 * Readiness checking configuration for VM instances. Unhealthy instances
 * are removed from traffic rotation.
 *
 * Generated from protobuf message <code>google.appengine.v1.ReadinessCheck</code>
 */
class ReadinessCheck extends \Google\Protobuf\Internal\Message
{
    /**
     * The request path.
     *
     * Generated from protobuf field <code>string path = 1;</code>
     */
    protected $path = '';
    /**
     * Host header to send when performing a HTTP Readiness check.
     * Example: "myapp.appspot.com"
     *
     * Generated from protobuf field <code>string host = 2;</code>
     */
    protected $host = '';
    /**
     * Number of consecutive failed checks required before removing
     * traffic.
     *
     * Generated from protobuf field <code>uint32 failure_threshold = 3;</code>
     */
    protected $failure_threshold = 0;
    /**
     * Number of consecutive successful checks required before receiving
     * traffic.
     *
     * Generated from protobuf field <code>uint32 success_threshold = 4;</code>
     */
    protected $success_threshold = 0;
    /**
     * Interval between health checks.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration check_interval = 5;</code>
     */
    protected $check_interval = null;
    /**
     * Time before the check is considered failed.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration timeout = 6;</code>
     */
    protected $timeout = null;
    /**
     * A maximum time limit on application initialization, measured from moment
     * the application successfully replies to a healthcheck until it is ready to
     * serve traffic.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration app_start_timeout = 7;</code>
     */
    protected $app_start_timeout = 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 Readiness check.
     *           Example: "myapp.appspot.com"
     *     @type int $failure_threshold
     *           Number of consecutive failed checks required before removing
     *           traffic.
     *     @type int $success_threshold
     *           Number of consecutive successful checks required before receiving
     *           traffic.
     *     @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 $app_start_timeout
     *           A maximum time limit on application initialization, measured from moment
     *           the application successfully replies to a healthcheck until it is ready to
     *           serve traffic.
     * }
     */
    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 Readiness 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 Readiness 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 removing
     * traffic.
     *
     * 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 removing
     * traffic.
     *
     * 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 receiving
     * traffic.
     *
     * 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 receiving
     * traffic.
     *
     * 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 $this->check_interval;
    }

    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 $this->timeout;
    }

    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;
    }

    /**
     * A maximum time limit on application initialization, measured from moment
     * the application successfully replies to a healthcheck until it is ready to
     * serve traffic.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration app_start_timeout = 7;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getAppStartTimeout()
    {
        return $this->app_start_timeout;
    }

    public function hasAppStartTimeout()
    {
        return isset($this->app_start_timeout);
    }

    public function clearAppStartTimeout()
    {
        unset($this->app_start_timeout);
    }

    /**
     * A maximum time limit on application initialization, measured from moment
     * the application successfully replies to a healthcheck until it is ready to
     * serve traffic.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration app_start_timeout = 7;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setAppStartTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->app_start_timeout = $var;

        return $this;
    }

}

