<?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;
    /**
     * Health state of the instance.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.HealthStatus.HealthState health_state = 55571694;</code>
     */
    private $health_state = 0;
    /**
     * URL of the instance resource.
     *
     * Generated from protobuf field <code>string instance = 18257045;</code>
     */
    private $instance = '';
    /**
     * A forwarding rule IP address assigned to this instance.
     *
     * Generated from protobuf field <code>string ip_address = 137836764;</code>
     */
    private $ip_address = '';
    /**
     * The named port of the instance group, not necessarily the port that is health-checked.
     *
     * Generated from protobuf field <code>int32 port = 3446913;</code>
     */
    private $port = 0;
    /**
     * Generated from protobuf field <code>string weight = 13714040;</code>
     */
    private $weight = '';
    /**
     * Generated from protobuf field <code>.google.cloud.compute.v1.HealthStatus.WeightError weight_error = 254066049;</code>
     */
    private $weight_error = 0;

    /**
     * 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 int $health_state
     *           Health state of the instance.
     *     @type string $instance
     *           URL of the instance resource.
     *     @type string $ip_address
     *           A forwarding rule IP address assigned to this instance.
     *     @type int $port
     *           The named port of the instance group, not necessarily the port that is health-checked.
     *     @type string $weight
     *     @type int $weight_error
     * }
     */
    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;
    }

    /**
     * Health state of the instance.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.HealthStatus.HealthState health_state = 55571694;</code>
     * @return int
     */
    public function getHealthState()
    {
        return $this->health_state;
    }

    /**
     * Health state of the instance.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.HealthStatus.HealthState health_state = 55571694;</code>
     * @param int $var
     * @return $this
     */
    public function setHealthState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\HealthStatus\HealthState::class);
        $this->health_state = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * A forwarding rule IP address assigned to this instance.
     *
     * Generated from protobuf field <code>string ip_address = 137836764;</code>
     * @return string
     */
    public function getIpAddress()
    {
        return $this->ip_address;
    }

    /**
     * A forwarding rule IP address assigned to this instance.
     *
     * Generated from protobuf field <code>string ip_address = 137836764;</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>int32 port = 3446913;</code>
     * @return int
     */
    public function getPort()
    {
        return $this->port;
    }

    /**
     * The named port of the instance group, not necessarily the port that is health-checked.
     *
     * Generated from protobuf field <code>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>string weight = 13714040;</code>
     * @return string
     */
    public function getWeight()
    {
        return $this->weight;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.cloud.compute.v1.HealthStatus.WeightError weight_error = 254066049;</code>
     * @return int
     */
    public function getWeightError()
    {
        return $this->weight_error;
    }

    /**
     * Generated from protobuf field <code>.google.cloud.compute.v1.HealthStatus.WeightError weight_error = 254066049;</code>
     * @param int $var
     * @return $this
     */
    public function setWeightError($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\HealthStatus\WeightError::class);
        $this->weight_error = $var;

        return $this;
    }

}

