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

namespace Google\Cloud\Compute\V1;

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

/**
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.HealthStatus</code>
 */
class HealthStatus extends \Google\Protobuf\Internal\Message
{
    /**
     * Metadata defined as annotations for network endpoint.
     *
     * Generated from protobuf field <code>map<string, string> annotations = 112032548;</code>
     */
    private $annotations;
    /**
     * URL of the forwarding rule associated with the health status of the instance.
     *
     * Generated from protobuf field <code>optional string forwarding_rule = 269964030;</code>
     */
    private $forwarding_rule = null;
    /**
     * A forwarding rule IP address assigned to this instance.
     *
     * Generated from protobuf field <code>optional string forwarding_rule_ip = 172250632;</code>
     */
    private $forwarding_rule_ip = null;
    /**
     * Health state of the instance.
     * Check the HealthState enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string health_state = 324007150;</code>
     */
    private $health_state = null;
    /**
     * URL of the instance resource.
     *
     * Generated from protobuf field <code>optional string instance = 18257045;</code>
     */
    private $instance = null;
    /**
     * For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip.
     *
     * Generated from protobuf field <code>optional string ip_address = 406272220;</code>
     */
    private $ip_address = null;
    /**
     * The named port of the instance group, not necessarily the port that is health-checked.
     *
     * Generated from protobuf field <code>optional int32 port = 3446913;</code>
     */
    private $port = null;
    /**
     * Generated from protobuf field <code>optional string weight = 282149496;</code>
     */
    private $weight = null;
    /**
     * 
     * Check the WeightError enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string weight_error = 522501505;</code>
     */
    private $weight_error = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $annotations
     *           Metadata defined as annotations for network endpoint.
     *     @type string $forwarding_rule
     *           URL of the forwarding rule associated with the health status of the instance.
     *     @type string $forwarding_rule_ip
     *           A forwarding rule IP address assigned to this instance.
     *     @type string $health_state
     *           Health state of the instance.
     *           Check the HealthState enum for the list of possible values.
     *     @type string $instance
     *           URL of the instance resource.
     *     @type string $ip_address
     *           For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip.
     *     @type int $port
     *           The named port of the instance group, not necessarily the port that is health-checked.
     *     @type string $weight
     *     @type string $weight_error
     *           
     *           Check the WeightError enum for the list of possible values.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Metadata defined as annotations for network endpoint.
     *
     * Generated from protobuf field <code>map<string, string> annotations = 112032548;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAnnotations()
    {
        return $this->annotations;
    }

    /**
     * Metadata defined as annotations for network endpoint.
     *
     * Generated from protobuf field <code>map<string, string> annotations = 112032548;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAnnotations($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->annotations = $arr;

        return $this;
    }

    /**
     * URL of the forwarding rule associated with the health status of the instance.
     *
     * Generated from protobuf field <code>optional string forwarding_rule = 269964030;</code>
     * @return string
     */
    public function getForwardingRule()
    {
        return isset($this->forwarding_rule) ? $this->forwarding_rule : '';
    }

    public function hasForwardingRule()
    {
        return isset($this->forwarding_rule);
    }

    public function clearForwardingRule()
    {
        unset($this->forwarding_rule);
    }

    /**
     * URL of the forwarding rule associated with the health status of the instance.
     *
     * Generated from protobuf field <code>optional string forwarding_rule = 269964030;</code>
     * @param string $var
     * @return $this
     */
    public function setForwardingRule($var)
    {
        GPBUtil::checkString($var, True);
        $this->forwarding_rule = $var;

        return $this;
    }

    /**
     * A forwarding rule IP address assigned to this instance.
     *
     * Generated from protobuf field <code>optional string forwarding_rule_ip = 172250632;</code>
     * @return string
     */
    public function getForwardingRuleIp()
    {
        return isset($this->forwarding_rule_ip) ? $this->forwarding_rule_ip : '';
    }

    public function hasForwardingRuleIp()
    {
        return isset($this->forwarding_rule_ip);
    }

    public function clearForwardingRuleIp()
    {
        unset($this->forwarding_rule_ip);
    }

    /**
     * A forwarding rule IP address assigned to this instance.
     *
     * Generated from protobuf field <code>optional string forwarding_rule_ip = 172250632;</code>
     * @param string $var
     * @return $this
     */
    public function setForwardingRuleIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->forwarding_rule_ip = $var;

        return $this;
    }

    /**
     * Health state of the instance.
     * Check the HealthState enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string health_state = 324007150;</code>
     * @return string
     */
    public function getHealthState()
    {
        return isset($this->health_state) ? $this->health_state : '';
    }

    public function hasHealthState()
    {
        return isset($this->health_state);
    }

    public function clearHealthState()
    {
        unset($this->health_state);
    }

    /**
     * Health state of the instance.
     * Check the HealthState enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string health_state = 324007150;</code>
     * @param string $var
     * @return $this
     */
    public function setHealthState($var)
    {
        GPBUtil::checkString($var, True);
        $this->health_state = $var;

        return $this;
    }

    /**
     * URL of the instance resource.
     *
     * Generated from protobuf field <code>optional string instance = 18257045;</code>
     * @return string
     */
    public function getInstance()
    {
        return isset($this->instance) ? $this->instance : '';
    }

    public function hasInstance()
    {
        return isset($this->instance);
    }

    public function clearInstance()
    {
        unset($this->instance);
    }

    /**
     * URL of the instance resource.
     *
     * Generated from protobuf field <code>optional string instance = 18257045;</code>
     * @param string $var
     * @return $this
     */
    public function setInstance($var)
    {
        GPBUtil::checkString($var, True);
        $this->instance = $var;

        return $this;
    }

    /**
     * For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip.
     *
     * Generated from protobuf field <code>optional string ip_address = 406272220;</code>
     * @return string
     */
    public function getIpAddress()
    {
        return isset($this->ip_address) ? $this->ip_address : '';
    }

    public function hasIpAddress()
    {
        return isset($this->ip_address);
    }

    public function clearIpAddress()
    {
        unset($this->ip_address);
    }

    /**
     * For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip.
     *
     * Generated from protobuf field <code>optional string ip_address = 406272220;</code>
     * @param string $var
     * @return $this
     */
    public function setIpAddress($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip_address = $var;

        return $this;
    }

    /**
     * The named port of the instance group, not necessarily the port that is health-checked.
     *
     * Generated from protobuf field <code>optional int32 port = 3446913;</code>
     * @return int
     */
    public function getPort()
    {
        return isset($this->port) ? $this->port : 0;
    }

    public function hasPort()
    {
        return isset($this->port);
    }

    public function clearPort()
    {
        unset($this->port);
    }

    /**
     * The named port of the instance group, not necessarily the port that is health-checked.
     *
     * Generated from protobuf field <code>optional int32 port = 3446913;</code>
     * @param int $var
     * @return $this
     */
    public function setPort($var)
    {
        GPBUtil::checkInt32($var);
        $this->port = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string weight = 282149496;</code>
     * @return string
     */
    public function getWeight()
    {
        return isset($this->weight) ? $this->weight : '';
    }

    public function hasWeight()
    {
        return isset($this->weight);
    }

    public function clearWeight()
    {
        unset($this->weight);
    }

    /**
     * Generated from protobuf field <code>optional string weight = 282149496;</code>
     * @param string $var
     * @return $this
     */
    public function setWeight($var)
    {
        GPBUtil::checkString($var, True);
        $this->weight = $var;

        return $this;
    }

    /**
     * 
     * Check the WeightError enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string weight_error = 522501505;</code>
     * @return string
     */
    public function getWeightError()
    {
        return isset($this->weight_error) ? $this->weight_error : '';
    }

    public function hasWeightError()
    {
        return isset($this->weight_error);
    }

    public function clearWeightError()
    {
        unset($this->weight_error);
    }

    /**
     * 
     * Check the WeightError enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string weight_error = 522501505;</code>
     * @param string $var
     * @return $this
     */
    public function setWeightError($var)
    {
        GPBUtil::checkString($var, True);
        $this->weight_error = $var;

        return $this;
    }

}

