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

/**
 * A pseudowire that connects two Interconnect connections.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.Wire</code>
 */
class Wire extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. [Output Only] Indicates whether the wire is enabled.
     * When false, the wire is disabled. When true and when the wire group of
     * the wire is also enabled, the wire is enabled. Defaults to true.
     *
     * Generated from protobuf field <code>optional bool admin_enabled = 445675089;</code>
     */
    protected $admin_enabled = null;
    /**
     * Output only. Wire endpoints are specific Interconnect connections.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.WireEndpoint endpoints = 287085950;</code>
     */
    private $endpoints;
    /**
     * Output only. [Output Only] A label that identifies the wire. The format of this label
     * combines the existing labels of the wire group endpoints and Interconnect
     * connections used by this wire in alphabetical order as follows:
     * `ENDPOINT_A+CONNECTION_A1,ENDPOINT_B+CONNECTION_B1`, where:
     *    - ENDPOINT_A and ENDPOINT_B: are the labels
     *    that you entered as map keys when you specified the wire group endpoint
     *    objects.
     *    - CONNECTION_A1 and CONNECTION_B1: are the
     *    labels that you entered as map keys when you specified the wire group
     *    Interconnect objects.
     *
     * Generated from protobuf field <code>optional string label = 102727412;</code>
     */
    protected $label = null;
    /**
     * Output only. [Output Only] Properties of the wire.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.WireProperties wire_properties = 303111469;</code>
     */
    protected $wire_properties = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $admin_enabled
     *           Output only. [Output Only] Indicates whether the wire is enabled.
     *           When false, the wire is disabled. When true and when the wire group of
     *           the wire is also enabled, the wire is enabled. Defaults to true.
     *     @type array<\Google\Cloud\Compute\V1\WireEndpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints
     *           Output only. Wire endpoints are specific Interconnect connections.
     *     @type string $label
     *           Output only. [Output Only] A label that identifies the wire. The format of this label
     *           combines the existing labels of the wire group endpoints and Interconnect
     *           connections used by this wire in alphabetical order as follows:
     *           `ENDPOINT_A+CONNECTION_A1,ENDPOINT_B+CONNECTION_B1`, where:
     *              - ENDPOINT_A and ENDPOINT_B: are the labels
     *              that you entered as map keys when you specified the wire group endpoint
     *              objects.
     *              - CONNECTION_A1 and CONNECTION_B1: are the
     *              labels that you entered as map keys when you specified the wire group
     *              Interconnect objects.
     *     @type \Google\Cloud\Compute\V1\WireProperties $wire_properties
     *           Output only. [Output Only] Properties of the wire.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. [Output Only] Indicates whether the wire is enabled.
     * When false, the wire is disabled. When true and when the wire group of
     * the wire is also enabled, the wire is enabled. Defaults to true.
     *
     * Generated from protobuf field <code>optional bool admin_enabled = 445675089;</code>
     * @return bool
     */
    public function getAdminEnabled()
    {
        return isset($this->admin_enabled) ? $this->admin_enabled : false;
    }

    public function hasAdminEnabled()
    {
        return isset($this->admin_enabled);
    }

    public function clearAdminEnabled()
    {
        unset($this->admin_enabled);
    }

    /**
     * Output only. [Output Only] Indicates whether the wire is enabled.
     * When false, the wire is disabled. When true and when the wire group of
     * the wire is also enabled, the wire is enabled. Defaults to true.
     *
     * Generated from protobuf field <code>optional bool admin_enabled = 445675089;</code>
     * @param bool $var
     * @return $this
     */
    public function setAdminEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->admin_enabled = $var;

        return $this;
    }

    /**
     * Output only. Wire endpoints are specific Interconnect connections.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.WireEndpoint endpoints = 287085950;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEndpoints()
    {
        return $this->endpoints;
    }

    /**
     * Output only. Wire endpoints are specific Interconnect connections.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.WireEndpoint endpoints = 287085950;</code>
     * @param array<\Google\Cloud\Compute\V1\WireEndpoint>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEndpoints($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\WireEndpoint::class);
        $this->endpoints = $arr;

        return $this;
    }

    /**
     * Output only. [Output Only] A label that identifies the wire. The format of this label
     * combines the existing labels of the wire group endpoints and Interconnect
     * connections used by this wire in alphabetical order as follows:
     * `ENDPOINT_A+CONNECTION_A1,ENDPOINT_B+CONNECTION_B1`, where:
     *    - ENDPOINT_A and ENDPOINT_B: are the labels
     *    that you entered as map keys when you specified the wire group endpoint
     *    objects.
     *    - CONNECTION_A1 and CONNECTION_B1: are the
     *    labels that you entered as map keys when you specified the wire group
     *    Interconnect objects.
     *
     * Generated from protobuf field <code>optional string label = 102727412;</code>
     * @return string
     */
    public function getLabel()
    {
        return isset($this->label) ? $this->label : '';
    }

    public function hasLabel()
    {
        return isset($this->label);
    }

    public function clearLabel()
    {
        unset($this->label);
    }

    /**
     * Output only. [Output Only] A label that identifies the wire. The format of this label
     * combines the existing labels of the wire group endpoints and Interconnect
     * connections used by this wire in alphabetical order as follows:
     * `ENDPOINT_A+CONNECTION_A1,ENDPOINT_B+CONNECTION_B1`, where:
     *    - ENDPOINT_A and ENDPOINT_B: are the labels
     *    that you entered as map keys when you specified the wire group endpoint
     *    objects.
     *    - CONNECTION_A1 and CONNECTION_B1: are the
     *    labels that you entered as map keys when you specified the wire group
     *    Interconnect objects.
     *
     * Generated from protobuf field <code>optional string label = 102727412;</code>
     * @param string $var
     * @return $this
     */
    public function setLabel($var)
    {
        GPBUtil::checkString($var, True);
        $this->label = $var;

        return $this;
    }

    /**
     * Output only. [Output Only] Properties of the wire.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.WireProperties wire_properties = 303111469;</code>
     * @return \Google\Cloud\Compute\V1\WireProperties|null
     */
    public function getWireProperties()
    {
        return $this->wire_properties;
    }

    public function hasWireProperties()
    {
        return isset($this->wire_properties);
    }

    public function clearWireProperties()
    {
        unset($this->wire_properties);
    }

    /**
     * Output only. [Output Only] Properties of the wire.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.WireProperties wire_properties = 303111469;</code>
     * @param \Google\Cloud\Compute\V1\WireProperties $var
     * @return $this
     */
    public function setWireProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\WireProperties::class);
        $this->wire_properties = $var;

        return $this;
    }

}

