<?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. [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. [Output only] ASNs in the path segment. This field is for better
     * support of 32 bit ASNs as the other asns field suffers from overflow when
     * the ASN is larger. When type is SEQUENCE, these are ordered.
     *
     * Generated from protobuf field <code>repeated uint32 asns32 = 202267158;</code>
     */
    private $asns32;
    /**
     * Output only. [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>
     */
    protected $type = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $asns
     *           Output only. [Output only] ASNs in the path segment. When type is SEQUENCE, these are
     *           ordered.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $asns32
     *           Output only. [Output only] ASNs in the path segment. This field is for better
     *           support of 32 bit ASNs as the other asns field suffers from overflow when
     *           the ASN is larger. When type is SEQUENCE, these are ordered.
     *     @type string $type
     *           Output only. [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. [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. [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. [Output only] ASNs in the path segment. This field is for better
     * support of 32 bit ASNs as the other asns field suffers from overflow when
     * the ASN is larger. When type is SEQUENCE, these are ordered.
     *
     * Generated from protobuf field <code>repeated uint32 asns32 = 202267158;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAsns32()
    {
        return $this->asns32;
    }

    /**
     * Output only. [Output only] ASNs in the path segment. This field is for better
     * support of 32 bit ASNs as the other asns field suffers from overflow when
     * the ASN is larger. When type is SEQUENCE, these are ordered.
     *
     * Generated from protobuf field <code>repeated uint32 asns32 = 202267158;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAsns32($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT32);
        $this->asns32 = $arr;

        return $this;
    }

    /**
     * Output only. [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. [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;
    }

}

