<?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.BgpRouteAsPath</code>
 */
class BgpRouteAsPath extends \Google\Protobuf\Internal\Message
{
    /**
     * [Output only] ASNs in the path segment. When type is SEQUENCE, these are ordered.
     *
     * Generated from protobuf field <code>repeated int32 asns = 3003767;</code>
     */
    private $asns;
    /**
     * [Output only] Type of AS-PATH segment (SEQUENCE or SET)
     * Check the Type enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string type = 3575610;</code>
     */
    private $type = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $asns
     *           [Output only] ASNs in the path segment. When type is SEQUENCE, these are ordered.
     *     @type string $type
     *           [Output only] Type of AS-PATH segment (SEQUENCE or SET)
     *           Check the Type enum for the list of possible values.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * [Output only] ASNs in the path segment. When type is SEQUENCE, these are ordered.
     *
     * Generated from protobuf field <code>repeated int32 asns = 3003767;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAsns()
    {
        return $this->asns;
    }

    /**
     * [Output only] ASNs in the path segment. When type is SEQUENCE, these are ordered.
     *
     * Generated from protobuf field <code>repeated int32 asns = 3003767;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAsns($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->asns = $arr;

        return $this;
    }

    /**
     * [Output only] Type of AS-PATH segment (SEQUENCE or SET)
     * Check the Type enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string type = 3575610;</code>
     * @return string
     */
    public function getType()
    {
        return isset($this->type) ? $this->type : '';
    }

    public function hasType()
    {
        return isset($this->type);
    }

    public function clearType()
    {
        unset($this->type);
    }

    /**
     * [Output only] Type of AS-PATH segment (SEQUENCE or SET)
     * Check the Type enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string type = 3575610;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->type = $var;

        return $this;
    }

}

