<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.BackendServiceHAPolicyLeaderNetworkEndpoint</code>
 */
class BackendServiceHAPolicyLeaderNetworkEndpoint extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the VM instance of the leader network endpoint. The
     * instance must already be attached to the NEG specified in the
     * haPolicy.leader.backendGroup.
     * The name must be 1-63 characters long, and comply with RFC1035.
     * Authorization requires the following IAM permission on the
     * specified resource instance: compute.instances.use
     *
     * Generated from protobuf field <code>optional string instance = 18257045;</code>
     */
    protected $instance = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $instance
     *           The name of the VM instance of the leader network endpoint. The
     *           instance must already be attached to the NEG specified in the
     *           haPolicy.leader.backendGroup.
     *           The name must be 1-63 characters long, and comply with RFC1035.
     *           Authorization requires the following IAM permission on the
     *           specified resource instance: compute.instances.use
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the VM instance of the leader network endpoint. The
     * instance must already be attached to the NEG specified in the
     * haPolicy.leader.backendGroup.
     * The name must be 1-63 characters long, and comply with RFC1035.
     * Authorization requires the following IAM permission on the
     * specified resource instance: compute.instances.use
     *
     * 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);
    }

    /**
     * The name of the VM instance of the leader network endpoint. The
     * instance must already be attached to the NEG specified in the
     * haPolicy.leader.backendGroup.
     * The name must be 1-63 characters long, and comply with RFC1035.
     * Authorization requires the following IAM permission on the
     * specified resource instance: compute.instances.use
     *
     * 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;
    }

}

